Skip to content

Commit

Permalink
Support for upcoming neural voices
Browse files Browse the repository at this point in the history
  • Loading branch information
Hagsten committed Jul 28, 2020
1 parent af3e983 commit 6d60624
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
12 changes: 10 additions & 2 deletions dist/talkify.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ talkify.controlcenters.classic = function () {
},{}],3:[function(require,module,exports){
talkify = talkify || {};
talkify.playbar = function (parent, correlationId) {
var mainFlags = ["de-DE", "fr-FR", "en-US", "zh-CN", "es-ES", "it-IT", "ja-JP", "ko-KR", "sv-SE", "nb-NO", "da-DK", "ru-RU", "nl-NL", "pl-PL", "tr-TR", "is-IS", "uk-UA", "sk-SK", "pt-PT", "ro-RO", "cy-GB", "bg-BG", "cs-CZ", "el-GR", "fi-FI", "he-IL", "hi-IN", "hr-HR", "hu-HU", "id-ID", "ms-MY", "sl-SI", "th-TH", "vi-VN", "ar-EG", "ar-SA", "ta-IN", "te-IN"];
var mainFlags = ["de-DE", "fr-FR", "en-US", "zh-CN", "es-ES", "it-IT", "ja-JP", "ko-KR", "sv-SE", "nb-NO", "da-DK", "ru-RU", "nl-NL", "pl-PL", "tr-TR", "is-IS", "uk-UA", "sk-SK", "pt-PT", "ro-RO", "cy-GB", "bg-BG", "cs-CZ", "el-GR", "fi-FI", "he-IL", "hi-IN", "hr-HR", "hu-HU", "id-ID", "ms-MY", "sl-SI", "th-TH", "vi-VN", "ar-EG", "ar-SA", "ta-IN", "te-IN", "en-GB-WLS", "ca-ES", "gu-IN", "ml-IN", "bn-IN", "kn-IN", "fil-PH"];

var settings = {
parentElement: parent || talkify.config.ui.audioControls.container || document.body
Expand Down Expand Up @@ -185,6 +185,10 @@ talkify.playbar = function (parent, correlationId) {
return mainFlags.indexOf(v.culture) !== -1;
});

if (!foo) {
continue;
}

var mainFlag = "https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.3.0/flags/4x3/" + foo.culture.split("-")[1].toLowerCase() + ".svg";

var li = createElement("li");
Expand Down Expand Up @@ -220,7 +224,11 @@ talkify.playbar = function (parent, correlationId) {

var d = createElement("div", "");

if (voice.isExclusive) {
if (voice.isNeural) {
var i = createElement("i", "fas fa-network-wired");
i.setAttribute("title", "Neural voice");
}
else if (voice.isExclusive) {
var i = createElement("i", "fas fa-star");
i.setAttribute("title", "Exclusive voice");
}
Expand Down
2 changes: 1 addition & 1 deletion dist/talkify.min.js

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions src/control-centers/talkify-controlcenter-core.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
talkify = talkify || {};
talkify.playbar = function (parent, correlationId) {
var mainFlags = ["de-DE", "fr-FR", "en-US", "zh-CN", "es-ES", "it-IT", "ja-JP", "ko-KR", "sv-SE", "nb-NO", "da-DK", "ru-RU", "nl-NL", "pl-PL", "tr-TR", "is-IS", "uk-UA", "sk-SK", "pt-PT", "ro-RO", "cy-GB", "bg-BG", "cs-CZ", "el-GR", "fi-FI", "he-IL", "hi-IN", "hr-HR", "hu-HU", "id-ID", "ms-MY", "sl-SI", "th-TH", "vi-VN", "ar-EG", "ar-SA", "ta-IN", "te-IN"];
var mainFlags = ["de-DE", "fr-FR", "en-US", "zh-CN", "es-ES", "it-IT", "ja-JP", "ko-KR", "sv-SE", "nb-NO", "da-DK", "ru-RU", "nl-NL", "pl-PL", "tr-TR", "is-IS", "uk-UA", "sk-SK", "pt-PT", "ro-RO", "cy-GB", "bg-BG", "cs-CZ", "el-GR", "fi-FI", "he-IL", "hi-IN", "hr-HR", "hu-HU", "id-ID", "ms-MY", "sl-SI", "th-TH", "vi-VN", "ar-EG", "ar-SA", "ta-IN", "te-IN", "en-GB-WLS", "ca-ES", "gu-IN", "ml-IN", "bn-IN", "kn-IN", "fil-PH"];

var settings = {
parentElement: parent || talkify.config.ui.audioControls.container || document.body
Expand Down Expand Up @@ -104,6 +104,10 @@ talkify.playbar = function (parent, correlationId) {
return mainFlags.indexOf(v.culture) !== -1;
});

if (!foo) {
continue;
}

var mainFlag = "https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.3.0/flags/4x3/" + foo.culture.split("-")[1].toLowerCase() + ".svg";

var li = createElement("li");
Expand Down Expand Up @@ -139,7 +143,11 @@ talkify.playbar = function (parent, correlationId) {

var d = createElement("div", "");

if (voice.isExclusive) {
if (voice.isNeural) {
var i = createElement("i", "fas fa-network-wired");
i.setAttribute("title", "Neural voice");
}
else if (voice.isExclusive) {
var i = createElement("i", "fas fa-star");
i.setAttribute("title", "Exclusive voice");
}
Expand Down

0 comments on commit 6d60624

Please sign in to comment.