Check Point
Rolling release / release (push) Successful in 6m36s

This commit is contained in:
2026-09-12 09:07:09 -04:00
parent e9040d110a
commit a4073b9020
63 changed files with 2459 additions and 632 deletions
+5 -4
View File
@@ -20,7 +20,7 @@ export class VadSegmenter extends EventEmitter {
this.reset();
}
reset() { this.speaking = false; this.buffer = []; this.speechMs = 0; this.silenceMs = 0; }
reset() { this.speaking = false; this.buffer = []; this.speechMs = 0; this.silenceMs = 0; this.recordingMs = 0; }
push(frame) {
const chunk = Buffer.from(frame || '');
@@ -34,11 +34,12 @@ export class VadSegmenter extends EventEmitter {
}
if (!this.speaking) return;
this.buffer.push(chunk);
this.recordingMs += durationMs;
if (voiced) { this.speechMs += durationMs; this.silenceMs = 0; }
else { this.silenceMs += durationMs; }
if (this.speechMs >= this.params.maxSpeechDurationMs ||
(this.speechMs >= this.params.minSpeechDurationMs && this.silenceMs >= this.params.minSilenceDurationMs)) {
this.end();
if (this.recordingMs >= this.params.maxSpeechDurationMs || this.silenceMs >= this.params.minSilenceDurationMs) {
if (this.speechMs >= this.params.minSpeechDurationMs) this.end();
else this.reset();
}
}