add namespace for custom provider

This commit is contained in:
Markus Frindt
2024-05-27 11:04:35 +02:00
parent 71f20178d3
commit 7618d334db
2 changed files with 4 additions and 2 deletions

2
.gitignore vendored
View File

@@ -39,3 +39,5 @@ node_modules
examples/*
.vscode
.env

View File

@@ -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;
}