diff --git a/lib/synth-audio.js b/lib/synth-audio.js index 213c4b1..38654c0 100644 --- a/lib/synth-audio.js +++ b/lib/synth-audio.js @@ -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 }; diff --git a/package-lock.json b/package-lock.json index 0744daf..cfaf36b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 2fa34cb..25dc49e 100644 --- a/package.json +++ b/package.json @@ -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",