mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-02-14 18:30:59 +00:00
support noise isolation
This commit is contained in:
@@ -19,7 +19,8 @@ class TaskConfig extends Task {
|
||||
'vad',
|
||||
'ttsStream',
|
||||
'autoStreamTts',
|
||||
'disableTtsCache'
|
||||
'disableTtsCache',
|
||||
'noiseIsolation'
|
||||
].forEach((k) => this[k] = this.data[k] || {});
|
||||
|
||||
if ('notifyEvents' in this.data) {
|
||||
@@ -90,6 +91,7 @@ class TaskConfig extends Task {
|
||||
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 hasNoiseIsolation() { return Object.keys(this.data).includes('noiseIsolation'); }
|
||||
|
||||
get summary() {
|
||||
const phrase = [];
|
||||
@@ -128,6 +130,7 @@ class TaskConfig extends Task {
|
||||
}
|
||||
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'}`);
|
||||
if (this.hasNoiseIsolation) phrase.push(`noiseIsolation ${this.noiseIsolation.enable ? 'on' : 'off'}`);
|
||||
return `${this.name}{${phrase.join(',')}}`;
|
||||
}
|
||||
|
||||
@@ -365,6 +368,17 @@ class TaskConfig extends Task {
|
||||
this.logger.info(`set disableTtsCache = ${this.disableTtsCache}`);
|
||||
cs.disableTtsCache = this.data.disableTtsCache;
|
||||
}
|
||||
|
||||
if (this.hasNoiseIsolation) {
|
||||
const {enable, ...opts} = this.noiseIsolation;
|
||||
if (enable) {
|
||||
this.logger.debug({opts}, 'Config: enabling noiseIsolation');
|
||||
cs.startBackgroundTask('noiseIsolation', {verb: 'noiseIsolation', ...opts});
|
||||
} else {
|
||||
this.logger.info('Config: disabling noiseIsolation');
|
||||
cs.stopBackgroundTask('noiseIsolation');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async kill(cs) {
|
||||
|
||||
Reference in New Issue
Block a user