Fix Silero VAD crash: disable external buffers in CircularBuffer.get()

Newer sherpa-onnx-node rejects external buffers by default, causing
"External buffers are not allowed" on every voice audio chunk.
This commit is contained in:
Mohamed Boudra
2026-04-04 19:16:07 +07:00
parent a17f7d2d20
commit fefe260f0a

View File

@@ -107,7 +107,7 @@ export class SherpaSileroVadSession extends EventEmitter implements TurnDetectio
const samples = pcm16leToFloat32(pcm16le, 1);
this.inputBuffer.push(samples);
while (this.inputBuffer.size() > this.windowSize) {
const window = this.inputBuffer.get(this.inputBuffer.head(), this.windowSize);
const window = this.inputBuffer.get(this.inputBuffer.head(), this.windowSize, false);
this.inputBuffer.pop(this.windowSize);
this.vad.acceptWaveform(window);
this.syncDetectionState();