mirror of
https://github.com/jambonz/speech-utils.git
synced 2026-10-04 17:14:42 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d606141f57 | ||
|
|
0d58954537 | ||
|
|
7c0eafded3 | ||
|
|
ab7d145288 |
+2
-4
@@ -170,8 +170,6 @@ async function synthAudio(client, logger, stats, { account_sid,
|
|||||||
|
|
||||||
client.setexAsync(key, EXPIRES, audioBuffer.toString('base64'))
|
client.setexAsync(key, EXPIRES, audioBuffer.toString('base64'))
|
||||||
.catch((err) => logger.error(err, `error calling setex on key ${key}`));
|
.catch((err) => logger.error(err, `error calling setex on key ${key}`));
|
||||||
|
|
||||||
if (['microsoft'].includes(vendor)) return {filePath, servedFromCache, rtt};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@@ -325,9 +323,9 @@ const synthMicrosoft = async(logger, {
|
|||||||
reject(cancellation.errorDetails);
|
reject(cancellation.errorDetails);
|
||||||
break;
|
break;
|
||||||
case ResultReason.SynthesizingAudioCompleted:
|
case ResultReason.SynthesizingAudioCompleted:
|
||||||
stats.increment('tts.count', ['vendor:microsoft', 'accepted:yes']);
|
resolve(Buffer.from(result.audioData));
|
||||||
resolve(result.audioData);
|
|
||||||
synthesizer.close();
|
synthesizer.close();
|
||||||
|
stats.increment('tts.count', ['vendor:microsoft', 'accepted:yes']);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
logger.info({result}, 'synthAudio: (Microsoft) unexpected result');
|
logger.info({result}, 'synthAudio: (Microsoft) unexpected result');
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@jambonz/speech-utils",
|
"name": "@jambonz/speech-utils",
|
||||||
"version": "0.0.10",
|
"version": "0.0.12",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@jambonz/speech-utils",
|
"name": "@jambonz/speech-utils",
|
||||||
"version": "0.0.10",
|
"version": "0.0.12",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-polly": "^3.303.0",
|
"@aws-sdk/client-polly": "^3.303.0",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@jambonz/speech-utils",
|
"name": "@jambonz/speech-utils",
|
||||||
"version": "0.0.10",
|
"version": "0.0.12",
|
||||||
"description": "TTS-related speech utilities for jambonz",
|
"description": "TTS-related speech utilities for jambonz",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"author": "Dave Horton",
|
"author": "Dave Horton",
|
||||||
|
|||||||
Reference in New Issue
Block a user