mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-07-04 19:32:01 +00:00
wip
This commit is contained in:
+7
-10
@@ -593,8 +593,6 @@ class TaskGather extends SttTask {
|
||||
this._onVendorConnectFailure.bind(this, cs, ep));
|
||||
this.addCustomEventListener(ep, HoundifyTranscriptionEvents.Connect,
|
||||
this._onVendorConnect.bind(this, cs, ep));
|
||||
this.addCustomEventListener(ep, HoundifyTranscriptionEvents.EoqVadTriggered,
|
||||
this._onHoundifyEoqVadTriggered.bind(this, cs, ep));
|
||||
break;
|
||||
|
||||
case 'voxist':
|
||||
@@ -762,13 +760,6 @@ class TaskGather extends SttTask {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* houndify mode=none: FS detected eoq/vad — send Done now if asrTimeout=0, else arm asrTimer. */
|
||||
_onHoundifyEoqVadTriggered(_cs, _ep, _evt, _fsEvent) {
|
||||
if (!this.asrTimeout) return this._sendHoundifyDone(this.ep);
|
||||
if (this._asrTimer) return;
|
||||
this._startAsrTimer();
|
||||
}
|
||||
|
||||
_startAsrTimer() {
|
||||
// Deepgram has a case that UtteranceEnd is not sent to cover the last word end time.
|
||||
// So we need to wait for the asrTimeout to be sure that the last word is sent.
|
||||
@@ -1122,8 +1113,14 @@ class TaskGather extends SttTask {
|
||||
if (!this.asrTimeout) this._sendHoundifyDone(this.ep);
|
||||
else this._startAsrTimer();
|
||||
} else if (transcript) {
|
||||
/* mode segmentation OFF: track last non-empty partial */
|
||||
/* mode segmentation OFF: FS module filters partials by eoq/vad threshold,
|
||||
* so any partial arriving here is an end-of-turn signal. */
|
||||
this._houndifyLastPartial = evt;
|
||||
const segMode = this.data.recognizer?.houndifyOptions?.requestInfo?.segmentation?.mode !== 'none';
|
||||
if (!segMode) {
|
||||
if (!this.asrTimeout) this._sendHoundifyDone(this.ep);
|
||||
else this._startAsrTimer();
|
||||
}
|
||||
}
|
||||
if (!transcript) emptyTranscript = true;
|
||||
}
|
||||
|
||||
+8
-11
@@ -353,8 +353,6 @@ class TaskTranscribe extends SttTask {
|
||||
this._onVendorConnectFailure.bind(this, cs, ep, channel));
|
||||
this.addCustomEventListener(ep, HoundifyTranscriptionEvents.Connect,
|
||||
this._onVendorConnect.bind(this, cs, ep));
|
||||
this.addCustomEventListener(ep, HoundifyTranscriptionEvents.EoqVadTriggered,
|
||||
this._onHoundifyEoqVadTriggered.bind(this, cs, ep, channel));
|
||||
break;
|
||||
|
||||
case 'voxist':
|
||||
@@ -654,9 +652,16 @@ class TaskTranscribe extends SttTask {
|
||||
if (!this.asrTimeout) this._sendHoundifyDone(channel === 2 ? this.ep2 : this.ep, channel);
|
||||
else this._startAsrTimer(channel);
|
||||
} else if (transcript) {
|
||||
/* mode segmentation OFF: track last non-empty partial per channel */
|
||||
/* mode segmentation OFF: FS module filters partials by eoq/vad threshold,
|
||||
* so any partial arriving here is an end-of-turn signal. */
|
||||
this._houndifyLastPartial = this._houndifyLastPartial || [null, null];
|
||||
this._houndifyLastPartial[channel - 1] = evt;
|
||||
const segMode = this.data.recognizer?.houndifyOptions?.requestInfo?.segmentation?.mode !== 'none';
|
||||
if (!segMode) {
|
||||
const ep = channel === 2 ? this.ep2 : this.ep;
|
||||
if (!this.asrTimeout) this._sendHoundifyDone(ep, channel);
|
||||
else this._startAsrTimer(channel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -936,14 +941,6 @@ class TaskTranscribe extends SttTask {
|
||||
this._onVendorError(cs, _ep, {error: JSON.stringify(e)});
|
||||
}
|
||||
|
||||
/* houndify mode=none: FS detected eoq/vad — send Done now if asrTimeout=0, else arm asrTimer. */
|
||||
_onHoundifyEoqVadTriggered(_cs, _ep, channel, _evt, _fsEvent) {
|
||||
const ep = channel === 2 ? this.ep2 : this.ep;
|
||||
if (!this.asrTimeout) return this._sendHoundifyDone(ep, channel);
|
||||
if (this._asrTimers?.[channel - 1]) return; /* idempotent per channel */
|
||||
this._startAsrTimer(channel);
|
||||
}
|
||||
|
||||
_startAsrTimer(channel) {
|
||||
if (this.vendor === 'deepgram') return; // no need
|
||||
assert(this.isContinuousAsr || this.vendor === 'houndify');
|
||||
|
||||
@@ -179,8 +179,7 @@
|
||||
"Transcription": "houndify_transcribe::transcription",
|
||||
"Error": "houndify_transcribe::error",
|
||||
"ConnectFailure": "houndify_transcribe::connect_failed",
|
||||
"Connect": "houndify_transcribe::connect",
|
||||
"EoqVadTriggered": "houndify_transcribe::eoq_vad_triggered"
|
||||
"Connect": "houndify_transcribe::connect"
|
||||
},
|
||||
"VoxistTranscriptionEvents": {
|
||||
"Transcription": "voxist_transcribe::transcription",
|
||||
|
||||
Reference in New Issue
Block a user