feat: add nuance, riva, ibm

This commit is contained in:
Quan HL
2023-02-21 08:49:15 +07:00
parent deee11b3f3
commit 1fed5aefab
23 changed files with 6779 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
const crypto = require('crypto');
/**
* Future TODO: cache recently used connections to providers
* to avoid connection overhead during a call.
* Will need to periodically age them out to avoid memory leaks.
*/
//const nuanceClientMap = new Map();
function makeSynthKey({vendor, language, voice, engine = '', text}) {
const hash = crypto.createHash('sha1');
hash.update(`${language}:${vendor}:${voice}:${engine}:${text}`);
return `tts:${hash.digest('hex')}`;
}
const noopLogger = {
info: () => {},
debug: () => {},
error: () => {}
};
module.exports = {
makeSynthKey,
noopLogger
};