mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-01-25 02:07:56 +00:00
Compare commits
4 Commits
v0.9.5-10
...
fix/fd_173
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe845604b1 | ||
|
|
58cb19dcde | ||
|
|
647f4ab51c | ||
|
|
922a034b2c |
@@ -230,17 +230,17 @@ class TaskGather extends SttTask {
|
||||
};
|
||||
|
||||
const startListening = async(cs, ep) => {
|
||||
if (this.killed || this.resolved) {
|
||||
this.logger.info('Gather:exec - task was quickly killed so do not transcribe');
|
||||
return;
|
||||
}
|
||||
this._startTimer();
|
||||
if (this.isContinuousAsr && 0 === this.timeout && !this.isBackgroundGather) {
|
||||
this._startAsrTimer();
|
||||
}
|
||||
if (this.input.includes('speech') && !this.listenDuringPrompt) {
|
||||
if (this.input.includes('speech')) {
|
||||
try {
|
||||
await this._setSpeechHandlers(cs, ep);
|
||||
if (this.killed) {
|
||||
this.logger.info('Gather:exec - task was quickly killed so do not transcribe');
|
||||
return;
|
||||
}
|
||||
this._startTranscribing(ep);
|
||||
} catch (e) {
|
||||
await this._startFallback(cs, ep, {error: e});
|
||||
@@ -259,7 +259,9 @@ class TaskGather extends SttTask {
|
||||
}
|
||||
this._stopVad();
|
||||
if (!this.killed && !this.resolved) {
|
||||
startListening(cs, ep);
|
||||
if (!this.listenDuringPrompt) {
|
||||
startListening(cs, ep);
|
||||
}
|
||||
if (this.input.includes('speech') && this.vendor === 'nuance' && this.listenDuringPrompt) {
|
||||
this.logger.debug('Gather:exec - starting transcription timers after say completes');
|
||||
ep.startTranscriptionTimers((err) => {
|
||||
@@ -297,7 +299,9 @@ class TaskGather extends SttTask {
|
||||
}
|
||||
this._stopVad();
|
||||
if (!this.killed && !this.resolved) {
|
||||
startListening(cs, ep);
|
||||
if (!this.listenDuringPrompt) {
|
||||
startListening(cs, ep);
|
||||
}
|
||||
if (this.input.includes('speech') && this.vendor === 'nuance' && this.listenDuringPrompt) {
|
||||
this.logger.debug('Gather:exec - starting transcription timers after play completes');
|
||||
ep.startTranscriptionTimers((err) => {
|
||||
@@ -305,6 +309,7 @@ class TaskGather extends SttTask {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
this.playTask.span = span;
|
||||
this.playTask.ctx = ctx;
|
||||
@@ -321,21 +326,12 @@ class TaskGather extends SttTask {
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (this.killed) {
|
||||
this.logger.info('Gather:exec - task was immediately killed so do not transcribe');
|
||||
return;
|
||||
}
|
||||
startListening(cs, ep);
|
||||
// listenDuringPrompt is set to false if there is no say or play task
|
||||
await startListening(cs, ep);
|
||||
}
|
||||
|
||||
if (this.input.includes('speech') && this.listenDuringPrompt) {
|
||||
await this._setSpeechHandlers(cs, ep);
|
||||
if (!this.resolved && !this.killed) {
|
||||
this._startTranscribing(ep);
|
||||
}
|
||||
else {
|
||||
this.logger.info('Gather:exec - task was killed or resolved quickly, not starting transcription');
|
||||
}
|
||||
if (this.listenDuringPrompt) {
|
||||
await startListening(cs, ep);
|
||||
}
|
||||
|
||||
// https://github.com/jambonz/jambonz-feature-server/issues/913
|
||||
|
||||
Reference in New Issue
Block a user