Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
xquanluu committed Jan 8, 2025
1 parent 3d5a514 commit 6dafcc8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/routes/api/speech-credentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ const encryptCredential = (obj) => {
options,
use_audio_resampling,
use_base64_encoding,
tts_streaming_sample_rate,
use_tls
} = obj;

Expand Down Expand Up @@ -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}`);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions lib/utils/speech-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6dafcc8

Please sign in to comment.