From 7cae19a4e54213f9c5af9a23441cb1ac12ef5dcb Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Mon, 30 Oct 2023 01:54:02 +0000 Subject: [PATCH] feat support google custom voice --- lib/synth-audio.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'}