mirror of
https://github.com/jambonz/speech-utils.git
synced 2025-12-18 19:27:46 +00:00
add namespace for custom provider
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -39,3 +39,5 @@ node_modules
|
||||
examples/*
|
||||
|
||||
.vscode
|
||||
|
||||
.env
|
||||
@@ -22,8 +22,8 @@ function makeSynthKey({account_sid = '', vendor, language, voice, engine = '', t
|
||||
hash.update(`${language}:${vendor}:${voice}:${engine}:${text}`);
|
||||
const hexHashKey = hash.digest('hex');
|
||||
const accountKey = account_sid ? `:${account_sid}` : '';
|
||||
const extension = getFileExtension(vendor);
|
||||
const key = `tts${accountKey}:${extension}:${hexHashKey}`;
|
||||
const namespace = vendor.startsWith('custom') ? vendor : getFileExtension(vendor);
|
||||
const key = `tts${accountKey}:${namespace}:${hexHashKey}`;
|
||||
return key;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user