mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
fix linting remove logs
This commit is contained in:
@@ -25,10 +25,6 @@ class TaskGather extends Task {
|
||||
/* when collecting dtmf, bargein on dtmf is true unless explicitly set to false */
|
||||
if (this.dtmfBargein !== false && this.input.includes('digits')) this.dtmfBargein = true;
|
||||
|
||||
this.listenDuringPrompt = this.data.listenDuringPrompt === false ? false : true;
|
||||
this.minBargeinWordCount = this.data.minBargeinWordCount || 1;
|
||||
|
||||
|
||||
this.timeout = (this.timeout || 15) * 1000;
|
||||
this.interim = this.partialResultCallback;
|
||||
if (this.data.recognizer) {
|
||||
@@ -52,6 +48,10 @@ class TaskGather extends Task {
|
||||
this.profanityOption = recognizer.profanityOption || 'raw';
|
||||
this.requestSnr = recognizer.requestSnr || false;
|
||||
this.initialSpeechTimeoutMs = recognizer.initialSpeechTimeoutMs || 0;
|
||||
|
||||
/* barge in configuration */
|
||||
this.listenDuringPrompt = this.data.listenDuringPrompt === false ? false : true;
|
||||
this.minBargeinWordCount = this.data.minBargeinWordCount || 1;
|
||||
}
|
||||
|
||||
this.digitBuffer = '';
|
||||
@@ -99,7 +99,6 @@ class TaskGather extends Task {
|
||||
}
|
||||
|
||||
const startListening = (cs, ep) => {
|
||||
this.logger.info({input: this.input, listenDuringPrompt: this.listenDuringPrompt}, 'started listening for speech events via startListening');
|
||||
this._startTimer();
|
||||
if (this.input.includes('speech') && !this.listenDuringPrompt) {
|
||||
this._initSpeech(cs, ep)
|
||||
@@ -116,7 +115,7 @@ class TaskGather extends Task {
|
||||
this.sayTask.exec(cs, ep); // kicked off, _not_ waiting for it to complete
|
||||
this.sayTask.on('playDone', (err) => {
|
||||
if (err) return this.logger.error({err}, 'Gather:exec Error playing tts');
|
||||
this.logger.info({killed: this.killed, listenAfterSpeech: this.listenAfterSpeech }, 'Gather: say task completed');
|
||||
this.logger.info('Gather: say task completed');
|
||||
if (!this.killed) {
|
||||
if (this.listenAfterSpeech === true) {
|
||||
startListening(cs, ep);
|
||||
@@ -197,7 +196,6 @@ class TaskGather extends Task {
|
||||
}
|
||||
|
||||
async _initSpeech(cs, ep) {
|
||||
this.logger.info('started listening on speech events initSpeechEnter');
|
||||
try {
|
||||
const opts = {};
|
||||
|
||||
@@ -257,14 +255,13 @@ class TaskGather extends Task {
|
||||
opts.AZURE_USE_OUTPUT_FORMAT_DETAILED = 1;
|
||||
|
||||
ep.addCustomEventListener(AzureTranscriptionEvents.Transcription, this._onTranscription.bind(this, cs, ep));
|
||||
ep.addCustomEventListener(AzureTranscriptionEvents.NoSpeechDetected, this._onNoSpeechDetected.bind(this, cs, ep));
|
||||
ep.addCustomEventListener(AzureTranscriptionEvents.NoSpeechDetected,
|
||||
this._onNoSpeechDetected.bind(this, cs, ep));
|
||||
}
|
||||
this.logger.info('started listening on speech events initSpeechDone');
|
||||
await ep.set(opts)
|
||||
.catch((err) => this.logger.info(err, 'Error setting channel variables'));
|
||||
|
||||
.catch((err) => this.logger.error(err, 'Error setting channel variables'));
|
||||
} catch (err) {
|
||||
this.logger.error({message: err.message, stack: err.stack}, "could not init speech for listening");
|
||||
this.logger.error(err, 'could not init speech for listening');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user