From 398904785b98a1c0a93111195449e29f928079ff Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Tue, 28 May 2024 12:58:37 -0400 Subject: [PATCH] lint --- lib/config.js | 3 ++- lib/synth-audio.js | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/config.js b/lib/config.js index 9482d90..09ac129 100644 --- a/lib/config.js +++ b/lib/config.js @@ -3,7 +3,8 @@ const JAMBONES_DISABLE_TTS_STREAMING = process.env.JAMBONES_DISABLE_TTS_STREAMIN const JAMBONES_HTTP_PROXY_IP = process.env.JAMBONES_HTTP_PROXY_IP; const JAMBONES_HTTP_PROXY_PORT = process.env.JAMBONES_HTTP_PROXY_PORT; -const JAMBONES_TTS_CACHE_DURATION_MINS = (parseInt(process.env.JAMBONES_TTS_CACHE_DURATION_MINS) || 4 * 60) * 60; // cache tts for 4 hours +const JAMBONES_TTS_CACHE_DURATION_MINS = + (parseInt(process.env.JAMBONES_TTS_CACHE_DURATION_MINS) || 4 * 60) * 60; // cache tts for 4 hours const TMP_FOLDER = '/tmp'; diff --git a/lib/synth-audio.js b/lib/synth-audio.js index 3a19c5b..50145b3 100644 --- a/lib/synth-audio.js +++ b/lib/synth-audio.js @@ -194,7 +194,7 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc case 'microsoft': vendorLabel = 'microsoft'; audioBuffer = await synthMicrosoft(logger, {credentials, stats, language, voice, text, deploymentId, - filePath, renderForCaching, disableTtsStreaming}); + filePath, renderForCaching, disableTtsStreaming}); break; case 'nuance': model = model || 'enhanced'; @@ -212,21 +212,21 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc case 'elevenlabs': audioBuffer = await synthElevenlabs(logger, { credentials, options, stats, language, voice, text, renderForCaching, disableTtsStreaming, filePath - }); + }); break; case 'playht': audioBuffer = await synthPlayHT(logger, { credentials, options, stats, language, voice, text, renderForCaching, disableTtsStreaming, filePath - }); + }); break; case 'rimelabs': audioBuffer = await synthRimelabs(logger, { credentials, options, stats, language, voice, text, renderForCaching, disableTtsStreaming, filePath - }); + }); break; case 'whisper': audioBuffer = await synthWhisper(logger, { - credentials, stats, voice, text, renderForCaching, disableTtsStreaming}); + credentials, stats, voice, text, renderForCaching, disableTtsStreaming}); break; case 'verbio': audioBuffer = await synthVerbio(client, logger, { @@ -235,7 +235,7 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc break; case 'deepgram': audioBuffer = await synthDeepgram(logger, {credentials, stats, model, text, - renderForCaching, disableTtsStreaming}); + renderForCaching, disableTtsStreaming}); break; case vendor.startsWith('custom') ? vendor : 'cant_match_value': ({ audioBuffer, filePath } = await synthCustomVendor(logger, @@ -244,7 +244,7 @@ async function synthAudio(client, createHash, retrieveHash, logger, stats, { acc default: assert(`synthAudio: unsupported speech vendor ${vendor}`); } - if('filePath' in audioBuffer) return audioBuffer; + if ('filePath' in audioBuffer) return audioBuffer; const diff = process.hrtime(startAt); const time = diff[0] * 1e3 + diff[1] * 1e-6; rtt = time.toFixed(0);