This commit is contained in:
Quan HL
2024-02-19 15:32:50 +07:00
3 changed files with 6 additions and 6 deletions

View File

@@ -145,7 +145,7 @@ async function synthAudio(client, logger, stats, { account_sid,
['microsoft', 'azure'].includes(vendor)
) ||
(
process.env.JAMBONES_ELEVENLABS_STREAMING &&
!process.env.JAMBONES_DISABLE_TTS_STREAMING &&
vendor === 'elevenlabs'
)
) {
@@ -615,7 +615,7 @@ const synthElevenlabs = async(logger, {credentials, options, stats, language, vo
const {api_key, model_id, options: credOpts, use_streaming} = credentials;
const opts = !!options && Object.keys(options).length !== 0 ? options : JSON.parse(credOpts || '{}');
/* if the env is set to stream then bag out, unless we are specifically rendering to generate a cache file */
/* default to using the streaming interface, unless disabled by env var OR we want just a cache file */
if (use_streaming && !renderForCaching) {
let params = '';
params += `{api_key=${api_key}`;
@@ -629,7 +629,7 @@ const synthElevenlabs = async(logger, {credentials, options, stats, language, vo
params += '}';
return {
filePath: `say:${params}${text.replace(/\n/g, ' ')}`,
filePath: `say:${params}${text.replace(/\n/g, ' ').replace(/\r/g, ' ')}`,
servedFromCache: false,
rtt: 0
};

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@jambonz/speech-utils",
"version": "0.0.38",
"version": "0.0.41",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@jambonz/speech-utils",
"version": "0.0.38",
"version": "0.0.41",
"license": "MIT",
"dependencies": {
"@aws-sdk/client-polly": "^3.496.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@jambonz/speech-utils",
"version": "0.0.38",
"version": "0.0.41",
"description": "TTS-related speech utilities for jambonz",
"main": "index.js",
"author": "Dave Horton",