mirror of
https://github.com/jambonz/speech-utils.git
synced 2025-12-19 03:37:49 +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/*
|
examples/*
|
||||||
|
|
||||||
.vscode
|
.vscode
|
||||||
|
|
||||||
|
.env
|
||||||
@@ -22,8 +22,8 @@ function makeSynthKey({account_sid = '', vendor, language, voice, engine = '', t
|
|||||||
hash.update(`${language}:${vendor}:${voice}:${engine}:${text}`);
|
hash.update(`${language}:${vendor}:${voice}:${engine}:${text}`);
|
||||||
const hexHashKey = hash.digest('hex');
|
const hexHashKey = hash.digest('hex');
|
||||||
const accountKey = account_sid ? `:${account_sid}` : '';
|
const accountKey = account_sid ? `:${account_sid}` : '';
|
||||||
const extension = getFileExtension(vendor);
|
const namespace = vendor.startsWith('custom') ? vendor : getFileExtension(vendor);
|
||||||
const key = `tts${accountKey}:${extension}:${hexHashKey}`;
|
const key = `tts${accountKey}:${namespace}:${hexHashKey}`;
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user