if streaming env is set prepare to use streaming tts

This commit is contained in:
Dave Horton
2024-01-20 14:15:13 -05:00
parent f36ba027d0
commit dabdb5b584
+11 -1
View File
@@ -194,7 +194,17 @@ async function synthAudio(client, logger, stats, { account_sid,
audioBuffer = await synthWellSaid(logger, {credentials, stats, language, voice, text, filePath});
break;
case 'elevenlabs':
audioBuffer = await synthElevenlabs(logger, {credentials, options, stats, language, voice, text, filePath});
if (process.env.JAMBONES_ELEVENLABS_STREAMING) {
return {
filePath: `say:${text}`,
servedFromCache: false,
rtt: 0
};
}
else {
audioBuffer = await synthElevenlabs(logger, {credentials, options, stats, language, voice, text, filePath});
}
break;
case 'whisper':
audioBuffer = await synthWhisper(logger, {credentials, stats, voice, text});