@@ -516,9 +516,10 @@ function AmazonPollyTtsEngine() {
516516 if ( voice . Style ) voiceName += ` +${ voice . Style } ` ;
517517 return {
518518 voiceName,
519- lang : voice . AdditionalLanguageCodes
519+ lang : voice . LanguageCode ,
520+ langs : voice . AdditionalLanguageCodes
520521 ? [ voice . LanguageCode , ...voice . AdditionalLanguageCodes ]
521- : voice . LanguageCode ,
522+ : undefined ,
522523 gender : voice . Gender . toLowerCase ( ) ,
523524 }
524525 } )
@@ -959,15 +960,15 @@ function PhoneTtsEngine() {
959960function OpenaiTtsEngine ( ) {
960961 this . defaultEndpointUrl = "https://api.openai.com/v1"
961962 this . defaultVoiceList = [
962- { voice : "alloy" , lang : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
963- { voice : "ash" , lang : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
964- { voice : "coral" , lang : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
965- { voice : "echo" , lang : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
966- { voice : "fable" , lang : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
967- { voice : "onyx" , lang : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
968- { voice : "nova" , lang : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
969- { voice : "sage" , lang : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
970- { voice : "shimmer" , lang : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
963+ { voice : "alloy" , langs : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
964+ { voice : "ash" , langs : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
965+ { voice : "coral" , langs : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
966+ { voice : "echo" , langs : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
967+ { voice : "fable" , langs : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
968+ { voice : "onyx" , langs : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
969+ { voice : "nova" , langs : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
970+ { voice : "sage" , langs : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
971+ { voice : "shimmer" , langs : [ "en-US" , "zh-CN" ] , model : "tts-1" } ,
971972 ]
972973 var prefetchAudio
973974 this . test = async function ( { apiKey, url, voiceList} ) {
@@ -999,9 +1000,10 @@ function OpenaiTtsEngine() {
9991000 this . getVoices = async function ( ) {
10001001 const openaiCreds = await getSetting ( "openaiCreds" )
10011002 const voiceList = openaiCreds ? ( openaiCreds . voiceList || this . defaultVoiceList ) : [ ]
1002- return voiceList . map ( ( { voice, lang} ) => ( {
1003+ return voiceList . map ( ( { voice, lang, langs } ) => ( {
10031004 voiceName : "OpenAI " + voice ,
1004- lang
1005+ lang,
1006+ langs
10051007 } ) )
10061008 }
10071009 async function getAudioUrl ( text , voice , pitch ) {
0 commit comments