From 6dafcc847579f0ffeab6c5ec9ad8e8123cdbb185 Mon Sep 17 00:00:00 2001 From: Quan HL Date: Wed, 8 Jan 2025 16:54:00 +0700 Subject: [PATCH] wip --- lib/routes/api/speech-credentials.js | 5 ++++- lib/utils/speech-utils.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/routes/api/speech-credentials.js b/lib/routes/api/speech-credentials.js index b3383c66..ca99525b 100644 --- a/lib/routes/api/speech-credentials.js +++ b/lib/routes/api/speech-credentials.js @@ -151,6 +151,7 @@ const encryptCredential = (obj) => { options, use_audio_resampling, use_base64_encoding, + tts_streaming_sample_rate, use_tls } = obj; @@ -288,7 +289,7 @@ const encryptCredential = (obj) => { default: if (vendor.startsWith('custom:')) { const customData = JSON.stringify({auth_token, custom_stt_url, custom_tts_url, - use_audio_resampling, use_base64_encoding, use_tls}); + use_audio_resampling, use_base64_encoding, use_tls, tts_streaming_sample_rate}); return encrypt(customData); } else assert(false, `invalid or missing vendor: ${vendor}`); @@ -482,6 +483,7 @@ router.put('/:sid', async(req, res) => { engine_version, use_audio_resampling, use_base64_encoding, + tts_streaming_sample_rate, use_tls } = req.body; @@ -513,6 +515,7 @@ router.put('/:sid', async(req, res) => { engine_version, use_audio_resampling, use_base64_encoding, + tts_streaming_sample_rate, use_tls }; logger.info({o, newCred}, 'updating speech credential with this new credential'); diff --git a/lib/utils/speech-utils.js b/lib/utils/speech-utils.js index 77329078..f0b5d701 100644 --- a/lib/utils/speech-utils.js +++ b/lib/utils/speech-utils.js @@ -627,6 +627,7 @@ function decryptCredential(obj, credential, logger, isObscureKey = true) { obj.use_audio_resampling = o.use_audio_resampling; obj.use_base64_encoding = o.use_base64_encoding; obj.use_tls = o.use_tls; + obj.tts_streaming_sample_rate = o.tts_streaming_sample_rate; } else if ('assemblyai' === obj.vendor) { const o = JSON.parse(decrypt(credential)); obj.api_key = isObscureKey ? obscureKey(o.api_key) : o.api_key;