From 750ed97312c41b82111427738e65a13222f01bae Mon Sep 17 00:00:00 2001 From: Quan HL Date: Thu, 9 Nov 2023 09:19:47 +0700 Subject: [PATCH] update review --- lib/synth-audio.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/synth-audio.js b/lib/synth-audio.js index 87ba9b2..50cd3f2 100644 --- a/lib/synth-audio.js +++ b/lib/synth-audio.js @@ -123,9 +123,9 @@ async function synthAudio(client, logger, stats, { account_sid, assert.ok(credentials.api_key, 'synthAudio requires api_key when elevenlabs is used'); assert.ok(credentials.model_id, 'synthAudio requires model_id when elevenlabs is used'); } else if ('whisper' === vendor) { - assert.ok(voice, 'synthAudio requires voice when openai is used'); - assert.ok(credentials.model, 'synthAudio requires model when openai is used'); - assert.ok(credentials.api_key, 'synthAudio requires api_key when openai is used'); + assert.ok(voice, 'synthAudio requires voice when whisper is used'); + assert.ok(credentials.model, 'synthAudio requires model when whisper is used'); + assert.ok(credentials.api_key, 'synthAudio requires api_key when whisper is used'); } else if (vendor.startsWith('custom')) { assert.ok(credentials.custom_tts_url, `synthAudio requires custom_tts_url in credentials when ${vendor} is used`); } @@ -603,7 +603,7 @@ const synthElevenlabs = async(logger, {credentials, stats, language, voice, text }); return mp3; } catch (err) { - logger.info({err}, 'synthEvenlabs returned error'); + logger.info({err}, 'synth Elevenlabs returned error'); stats.increment('tts.count', ['vendor:elevenlabs', 'accepted:no']); throw err; } @@ -626,7 +626,7 @@ const synthWhisper = async(logger, {credentials, stats, voice, text}) => { }); return Buffer.from(await mp3.arrayBuffer()); } catch (err) { - logger.info({err}, 'synthEvenlabs returned error'); + logger.info({err}, 'synth whisper returned error'); stats.increment('tts.count', ['vendor:openai', 'accepted:no']); throw err; }