diff --git a/lib/synth-audio.js b/lib/synth-audio.js index e525a97..6fdd5f9 100644 --- a/lib/synth-audio.js +++ b/lib/synth-audio.js @@ -183,7 +183,15 @@ async function synthAudio(client, logger, stats, { account_sid, case 'azure': case 'microsoft': vendorLabel = 'microsoft'; - audioBuffer = await synthMicrosoft(logger, {credentials, stats, language, voice, text, deploymentId, filePath}); + 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}); + } break; case 'nuance': model = model || 'enhanced';