@jambonz/speech-utils 0.0.38 → 0.0.40

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.
@@ -611,8 +611,8 @@ const synthElevenlabs = async(logger, {credentials, options, stats, language, vo
611
611
  const {api_key, model_id, options: credOpts} = credentials;
612
612
  const opts = !!options && Object.keys(options).length !== 0 ? options : JSON.parse(credOpts || '{}');
613
613
 
614
- /* if the env is set to stream then bag out, unless we are specifically rendering to generate a cache file */
615
- if (process.env.JAMBONES_ELEVENLABS_STREAMING && !renderForCaching) {
614
+ /* default to using the streaming interface, unless disabled by env var OR we want just a cache file */
615
+ if (!process.env.JAMBONES_DISABLE_TTS_STREAMING && !renderForCaching) {
616
616
  let params = '';
617
617
  params += `{api_key=${api_key}`;
618
618
  params += `,model_id=${model_id}`;
@@ -625,7 +625,7 @@ const synthElevenlabs = async(logger, {credentials, options, stats, language, vo
625
625
  params += '}';
626
626
 
627
627
  return {
628
- filePath: `say:${params}${text.replace(/\n/g, ' ')}`,
628
+ filePath: `say:${params}${text.replace(/\n/g, ' ').replace(/\r/g, ' ')}`,
629
629
  servedFromCache: false,
630
630
  rtt: 0
631
631
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jambonz/speech-utils",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "description": "TTS-related speech utilities for jambonz",
5
5
  "main": "index.js",
6
6
  "author": "Dave Horton",