@jambonz/speech-utils 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/synth-audio.js +2 -4
- package/package.json +1 -1
package/lib/synth-audio.js
CHANGED
|
@@ -170,8 +170,6 @@ async function synthAudio(client, logger, stats, { account_sid,
|
|
|
170
170
|
|
|
171
171
|
client.setexAsync(key, EXPIRES, audioBuffer.toString('base64'))
|
|
172
172
|
.catch((err) => logger.error(err, `error calling setex on key ${key}`));
|
|
173
|
-
|
|
174
|
-
if (['microsoft'].includes(vendor)) return {filePath, servedFromCache, rtt};
|
|
175
173
|
}
|
|
176
174
|
|
|
177
175
|
return new Promise((resolve, reject) => {
|
|
@@ -325,9 +323,9 @@ const synthMicrosoft = async(logger, {
|
|
|
325
323
|
reject(cancellation.errorDetails);
|
|
326
324
|
break;
|
|
327
325
|
case ResultReason.SynthesizingAudioCompleted:
|
|
328
|
-
|
|
329
|
-
resolve(result.audioData);
|
|
326
|
+
resolve(Buffer.from(result.audioData));
|
|
330
327
|
synthesizer.close();
|
|
328
|
+
stats.increment('tts.count', ['vendor:microsoft', 'accepted:yes']);
|
|
331
329
|
break;
|
|
332
330
|
default:
|
|
333
331
|
logger.info({result}, 'synthAudio: (Microsoft) unexpected result');
|