mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
support custom tts streaming (#1023)
* support custom tts streaming * wip * wip * wip * wip * wip * wip * fix review comments
This commit is contained in:
@@ -258,6 +258,11 @@
|
||||
"ConnectFailure": "elevenlabs_tts_streaming::connect_failed",
|
||||
"Connect": "elevenlabs_tts_streaming::connect"
|
||||
},
|
||||
"CustomTtsStreamingEvents": {
|
||||
"Empty": "custom_tts_streaming::empty",
|
||||
"ConnectFailure": "custom_tts_streaming::connect_failed",
|
||||
"Connect": "custom_tts_streaming::connect"
|
||||
},
|
||||
"TtsStreamingEvents": {
|
||||
"Empty": "tts_streaming::empty",
|
||||
"Pause": "tts_streaming::pause",
|
||||
|
||||
@@ -143,6 +143,7 @@ const speechMapper = (cred) => {
|
||||
obj.auth_token = o.auth_token;
|
||||
obj.custom_stt_url = o.custom_stt_url;
|
||||
obj.custom_tts_url = o.custom_tts_url;
|
||||
obj.custom_tts_streaming_url = o.custom_tts_streaming_url;
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
|
||||
@@ -214,7 +214,7 @@ class TtsStreamingBuffer extends Emitter {
|
||||
}
|
||||
|
||||
async _api(ep, args) {
|
||||
const apiCmd = `uuid_${this.vendor}_tts_streaming`;
|
||||
const apiCmd = `uuid_${this.vendor.startsWith('custom:') ? 'custom' : this.vendor}_tts_streaming`;
|
||||
const res = await ep.api(apiCmd, `^^|${args.join('|')}`);
|
||||
if (!res.body?.startsWith('+OK')) {
|
||||
this.logger.info({args}, `Error calling ${apiCmd}: ${res.body}`);
|
||||
@@ -277,7 +277,8 @@ class TtsStreamingBuffer extends Emitter {
|
||||
// DH: add other vendors here as modules are added
|
||||
'deepgram',
|
||||
'cartesia',
|
||||
'elevenlabs'
|
||||
'elevenlabs',
|
||||
'custom'
|
||||
].forEach((vendor) => {
|
||||
const eventClassName = `${vendor.charAt(0).toUpperCase() + vendor.slice(1)}TtsStreamingEvents`;
|
||||
const eventClass = require('../utils/constants')[eventClassName];
|
||||
|
||||
Reference in New Issue
Block a user