mirror of
https://github.com/jambonz/speech-utils.git
synced 2026-07-24 21:22:00 +00:00
fix issue in prev commit for microsoft
This commit is contained in:
+1
-3
@@ -170,8 +170,6 @@ async function synthAudio(client, logger, stats, { account_sid,
|
||||
|
||||
client.setexAsync(key, EXPIRES, audioBuffer.toString('base64'))
|
||||
.catch((err) => logger.error(err, `error calling setex on key ${key}`));
|
||||
|
||||
if (['microsoft'].includes(vendor)) return {filePath, servedFromCache, rtt};
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
@@ -325,9 +323,9 @@ const synthMicrosoft = async(logger, {
|
||||
reject(cancellation.errorDetails);
|
||||
break;
|
||||
case ResultReason.SynthesizingAudioCompleted:
|
||||
stats.increment('tts.count', ['vendor:microsoft', 'accepted:yes']);
|
||||
resolve(Buffer.from(result.audioData));
|
||||
synthesizer.close();
|
||||
stats.increment('tts.count', ['vendor:microsoft', 'accepted:yes']);
|
||||
break;
|
||||
default:
|
||||
logger.info({result}, 'synthAudio: (Microsoft) unexpected result');
|
||||
|
||||
Reference in New Issue
Block a user