feat support google custom voice

This commit is contained in:
Hoan Luu Huu
2023-10-30 01:54:02 +00:00
parent 8c4d5a7cee
commit 7cae19a4e5
+2 -2
View File
@@ -257,8 +257,8 @@ const synthGoogle = async(logger, {credentials, stats, language, voice, gender,
const client = new ttsGoogle.TextToSpeechClient(credentials);
const opts = {
voice: {
...( typeof voice === 'string' && {name: voice, ssmlGender: gender || 'SSML_VOICE_GENDER_UNSPECIFIED'}),
...( typeof voice === 'object' && {custom_voice: voice}),
...(typeof voice === 'string' && {name: voice, ssmlGender: gender || 'SSML_VOICE_GENDER_UNSPECIFIED'}),
...(typeof voice === 'object' && {custom_voice: voice}),
languageCode: language,
},
audioConfig: {audioEncoding: 'MP3'}