mirror of
https://github.com/jambonz/speech-utils.git
synced 2026-01-25 02:08:26 +00:00
wip
This commit is contained in:
@@ -184,14 +184,8 @@ async function synthAudio(client, logger, stats, { account_sid,
|
||||
case 'microsoft':
|
||||
vendorLabel = 'microsoft';
|
||||
audioBuffer = await synthMicrosoft(logger, {credentials, stats, language, voice, text, deploymentId,
|
||||
filePath, renderForCaching});
|
||||
if (typeof audioBuffer === 'object' && audioBuffer.filePath) {
|
||||
return audioBuffer;
|
||||
}
|
||||
else {
|
||||
audioBuffer = await synthMicrosoft(logger, {credentials, stats, language, voice, text, deploymentId,
|
||||
filePath, renderForCaching});
|
||||
}
|
||||
filePath, renderForCaching, disableTtsStreaming});
|
||||
if (audioBuffer?.filePath) return audioBuffer;
|
||||
break;
|
||||
case 'nuance':
|
||||
model = model || 'enhanced';
|
||||
@@ -390,7 +384,8 @@ const synthMicrosoft = async(logger, {
|
||||
voice,
|
||||
text,
|
||||
filePath,
|
||||
renderForCaching
|
||||
renderForCaching,
|
||||
disableTtsStreaming
|
||||
}) => {
|
||||
try {
|
||||
const {api_key: apiKey, region, use_custom_tts, custom_tts_endpoint, custom_tts_endpoint_url} = credentials;
|
||||
@@ -412,7 +407,7 @@ const synthMicrosoft = async(logger, {
|
||||
logger.info({content}, 'synthMicrosoft');
|
||||
}
|
||||
|
||||
if (!process.env.JAMBONES_DISABLE_TTS_STREAMING && !renderForCaching) {
|
||||
if (!process.env.JAMBONES_DISABLE_TTS_STREAMING && !renderForCaching && !disableTtsStreaming) {
|
||||
let params = '';
|
||||
params += `{api_key=${apiKey}`;
|
||||
params += `,language=${language}`;
|
||||
|
||||
Reference in New Issue
Block a user