naxodev
OSS
naxodev/mar
fix: forward client VAD events to voice-engine and use them to finalize transcripts (#15) Description: --- ## Summary - Forward client-side VAD (speech_start/speech_end) events into the voice-engine via a new handleVADEvent method, so the engine is aware of speech boundaries detected in the browser - Use VAD speech_end to mark the next interim transcript as final, with a 200ms debounce fallback if no new interim arrives — prevents Deepgram from hanging on open-ended streams - Fix STT-provider VAD events (from Deepgram) that were logged but never propagated to listeners/callbacks ## Changes engine/src/lib/voice/types.ts - Added handleVADEvent(event: VADEvent) to the VoiceEngine interface engine/src/lib/voice/voice-engine.ts - Implemented handleVADEvent: propagates to listeners/callbacks, and on speech_end sets a flag so the next interim is promoted to final (or debounces at 200ms to finalize the last known transcript) - Fixed handleSTTEvent vad case: now propagates to vadListeners and callbacks.onVADEvent instead of just logging - Added hasEmittedFinal guard to prevent duplicate final transcripts between the VAD path and stopListening() mar/maelstrom/server/api/src/lib/maelstrom-ws.ts - Added voiceEngine.handleVADEvent() calls in both vad.speech_start and vad.speech_end handlers, alongside the existing inline barge-in + start/stop listening logic (preserved for recording and Deepgram stream management)
nx run-many -t e2e
Sign in / Sign up
Open main menu
Succeeded
CI Pipeline Execution
nx run-many -t e2e
Click to copy
Linux
2 CPU cores
read-write
access token used
d9b89d27
main