@jambonz/speech-utils 0.1.2 → 0.1.3

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/config.js CHANGED
@@ -3,7 +3,8 @@ const JAMBONES_DISABLE_TTS_STREAMING = process.env.JAMBONES_DISABLE_TTS_STREAMIN
3
3
 
4
4
  const JAMBONES_HTTP_PROXY_IP = process.env.JAMBONES_HTTP_PROXY_IP;
5
5
  const JAMBONES_HTTP_PROXY_PORT = process.env.JAMBONES_HTTP_PROXY_PORT;
6
- const JAMBONES_TTS_CACHE_DURATION_MINS = (parseInt(process.env.JAMBONES_TTS_CACHE_DURATION_MINS) || 4 * 60) * 60; // cache tts for 4 hours
6
+ const JAMBONES_TTS_CACHE_DURATION_MINS =
7
+ (parseInt(process.env.JAMBONES_TTS_CACHE_DURATION_MINS) || 4 * 60) * 60; // cache tts for 4 hours
7
8
 
8
9
  const TMP_FOLDER = '/tmp';
9
10
 
@@ -194,7 +194,7 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc
194
194
  case 'microsoft':
195
195
  vendorLabel = 'microsoft';
196
196
  audioBuffer = await synthMicrosoft(logger, {credentials, stats, language, voice, text, deploymentId,
197
- filePath, renderForCaching, disableTtsStreaming});
197
+ filePath, renderForCaching, disableTtsStreaming});
198
198
  break;
199
199
  case 'nuance':
200
200
  model = model || 'enhanced';
@@ -212,21 +212,21 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc
212
212
  case 'elevenlabs':
213
213
  audioBuffer = await synthElevenlabs(logger, {
214
214
  credentials, options, stats, language, voice, text, renderForCaching, disableTtsStreaming, filePath
215
- });
215
+ });
216
216
  break;
217
217
  case 'playht':
218
218
  audioBuffer = await synthPlayHT(logger, {
219
219
  credentials, options, stats, language, voice, text, renderForCaching, disableTtsStreaming, filePath
220
- });
220
+ });
221
221
  break;
222
222
  case 'rimelabs':
223
223
  audioBuffer = await synthRimelabs(logger, {
224
224
  credentials, options, stats, language, voice, text, renderForCaching, disableTtsStreaming, filePath
225
- });
225
+ });
226
226
  break;
227
227
  case 'whisper':
228
228
  audioBuffer = await synthWhisper(logger, {
229
- credentials, stats, voice, text, renderForCaching, disableTtsStreaming});
229
+ credentials, stats, voice, text, renderForCaching, disableTtsStreaming});
230
230
  break;
231
231
  case 'verbio':
232
232
  audioBuffer = await synthVerbio(client, logger, {
@@ -235,7 +235,7 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc
235
235
  break;
236
236
  case 'deepgram':
237
237
  audioBuffer = await synthDeepgram(logger, {credentials, stats, model, text,
238
- renderForCaching, disableTtsStreaming});
238
+ renderForCaching, disableTtsStreaming});
239
239
  break;
240
240
  case vendor.startsWith('custom') ? vendor : 'cant_match_value':
241
241
  ({ audioBuffer, filePath } = await synthCustomVendor(logger,
@@ -244,7 +244,7 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc
244
244
  default:
245
245
  assert(`synthAudio: unsupported speech vendor ${vendor}`);
246
246
  }
247
- if('filePath' in audioBuffer) return audioBuffer;
247
+ if ('filePath' in audioBuffer) return audioBuffer;
248
248
  const diff = process.hrtime(startAt);
249
249
  const time = diff[0] * 1e3 + diff[1] * 1e-6;
250
250
  rtt = time.toFixed(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jambonz/speech-utils",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "TTS-related speech utilities for jambonz",
5
5
  "main": "index.js",
6
6
  "author": "Dave Horton",