mirror of
https://github.com/jambonz/speech-utils.git
synced 2025-12-19 03:37:49 +00:00
fix review comment
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user