mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-19 04:17:44 +00:00
Merge branch 'main' into feat/gh_1160
This commit is contained in:
@@ -658,6 +658,15 @@ class CallSession extends Emitter {
|
||||
}
|
||||
}
|
||||
|
||||
// disableTtsCache
|
||||
get disableTtsCache() {
|
||||
return this._disableTtsCache || false;
|
||||
}
|
||||
|
||||
set disableTtsCache(d) {
|
||||
this._disableTtsCache = d;
|
||||
}
|
||||
|
||||
getTsStreamingVendor() {
|
||||
let v;
|
||||
if (this.currentTask?.isStreamingTts) {
|
||||
|
||||
@@ -18,7 +18,8 @@ class TaskConfig extends Task {
|
||||
'boostAudioSignal',
|
||||
'vad',
|
||||
'ttsStream',
|
||||
'autoStreamTts'
|
||||
'autoStreamTts',
|
||||
'disableTtsCache'
|
||||
].forEach((k) => this[k] = this.data[k] || {});
|
||||
|
||||
if ('notifyEvents' in this.data) {
|
||||
@@ -88,6 +89,7 @@ class TaskConfig extends Task {
|
||||
get hasReferHook() { return Object.keys(this.data).includes('referHook'); }
|
||||
get hasNotifySttLatency() { return Object.keys(this.data).includes('notifySttLatency'); }
|
||||
get hasTtsStream() { return Object.keys(this.ttsStream).length; }
|
||||
get hasDisableTtsCache() { return Object.keys(this.data).includes('disableTtsCache'); }
|
||||
|
||||
get summary() {
|
||||
const phrase = [];
|
||||
@@ -125,6 +127,7 @@ class TaskConfig extends Task {
|
||||
phrase.push(`${this.ttsStream.enable ? 'enable' : 'disable'} ttsStream`);
|
||||
}
|
||||
if ('autoStreamTts' in this.data) phrase.push(`enable Say.stream value ${this.data.autoStreamTts ? 'on' : 'off'}`);
|
||||
if (this.hasDisableTtsCache) phrase.push(`disableTtsCache ${this.data.disableTtsCache ? 'on' : 'off'}`);
|
||||
return `${this.name}{${phrase.join(',')}}`;
|
||||
}
|
||||
|
||||
@@ -357,6 +360,11 @@ class TaskConfig extends Task {
|
||||
this.logger.info('Config: disabling ttsStream');
|
||||
cs.disableTtsStream();
|
||||
}
|
||||
|
||||
if (this.hasDisableTtsCache) {
|
||||
this.logger.info(`set disableTtsCache = ${this.disableTtsCache}`);
|
||||
cs.disableTtsCache = this.data.disableTtsCache;
|
||||
}
|
||||
}
|
||||
|
||||
async kill(cs) {
|
||||
|
||||
@@ -41,6 +41,10 @@ class TtsTask extends Task {
|
||||
|
||||
async exec(cs) {
|
||||
super.exec(cs);
|
||||
// update disableTtsCache from call session if not set in task
|
||||
if (this.data.disableTtsCache == null) {
|
||||
this.disableTtsCache = cs.disableTtsCache;
|
||||
}
|
||||
if (cs.synthesizer) {
|
||||
this.options = {...cs.synthesizer.options, ...this.options};
|
||||
this.data.synthesizer = this.data.synthesizer || {};
|
||||
|
||||
Reference in New Issue
Block a user