From 4ffae38a3f87401954a6b180529196998b2a1d8f Mon Sep 17 00:00:00 2001 From: Quan HL Date: Mon, 26 Feb 2024 13:49:37 +0700 Subject: [PATCH] wip --- lib/synth-audio.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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';