mirror of
https://github.com/jambonz/speech-utils.git
synced 2026-07-24 13:11:56 +00:00
feat: add nuance, riva, ibm
This commit is contained in:
@@ -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
|
||||
};
|
||||
Reference in New Issue
Block a user