diff --git a/lib/synth-audio.js b/lib/synth-audio.js index a8c35b2..a19b8ed 100644 --- a/lib/synth-audio.js +++ b/lib/synth-audio.js @@ -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'}