fix review comment

This commit is contained in:
Quan HL
2024-10-31 20:30:35 +07:00
parent 115faa9f89
commit 153ac3f1a4

View File

@@ -354,7 +354,7 @@ const synthPolly = async(createHash, retrieveHash, logger,
const synthGoogle = async(logger, {credentials, stats, language, voice, gender, text}) => {
const client = new ttsGoogle.TextToSpeechClient(credentials);
// If google custom voice cloning is used.
// At this time 31 Oct 2024, google node sdk has not support cloning voice yet.
// At this time 31 Oct 2024, google node sdk has not support voice cloning yet.
if (typeof voice === 'object' && voice.voice_cloning_key) {
try {
const accessToken = await client.auth.getAccessToken();
@@ -383,8 +383,8 @@ const synthGoogle = async(logger, {credentials, stats, language, voice, gender,
}
};
const mp3 = await post('/v1beta1/text:synthesize', payload);
return Buffer.from(mp3.audioContent, 'base64');
const wav = await post('/v1beta1/text:synthesize', payload);
return Buffer.from(wav.audioContent, 'base64');
} catch (err) {
logger.info({err: await err.text()}, 'synthGoogle returned error');
throw err;