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