diff --git a/lib/synth-audio.js b/lib/synth-audio.js index a19b8ed..1ba7cc0 100644 --- a/lib/synth-audio.js +++ b/lib/synth-audio.js @@ -257,9 +257,10 @@ 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 === 'string' && {name: voice}), ...(typeof voice === 'object' && {custom_voice: voice}), languageCode: language, + ssmlGender: gender || 'SSML_VOICE_GENDER_UNSPECIFIED' }, audioConfig: {audioEncoding: 'MP3'} };