tts key should include model

This commit is contained in:
Quan HL
2025-02-02 18:54:16 +07:00
parent 37fb045431
commit e1292772e6
5 changed files with 17 additions and 7 deletions
+9 -2
View File
@@ -17,9 +17,16 @@ const debug = require('debug')('jambonz:realtimedb-helpers');
//const nuanceClientMap = new Map();
function makeSynthKey({
account_sid = '', vendor, language, voice, engine = '', text}) {
account_sid = '',
vendor,
language,
voice,
engine = '',
model = '',
text
}) {
const hash = crypto.createHash('sha1');
hash.update(`${language}:${vendor}:${voice}:${engine}:${text}`);
hash.update(`${language}:${vendor}:${voice}:${engine}:${model}:${text}`);
const hexHashKey = hash.digest('hex');
const accountKey = account_sid ? `:${account_sid}` : '';
const key = `tts${accountKey}:${hexHashKey}`;