How ak4off/vad-in-process-streaming-asr-decode works
This repository is an in-memory, VAD-based streaming ASR decoder. The principal workflow loads the speech model once, finds input audio, slices speech-only chunks in memory, decodes them sequentially with optional prior-chunk prompt context, cleans and optionally seam-deduplicates text, then writes merged transcripts, timed WebVTT cues, and per-chunk TSV records. A separate optional CLI writes VAD chunks to disk. The README documents these branches; some implementation details, including output-writing code, were not included in the sampled excerpts.
Main entry points: decode_ctx_vad_vtt.py Decode driver · chunk_audio.py Speech chunking · inmemory_speech_dataset.py In-memory dataset · prompt_dynamic_language.yaml Language prompt
Components 18
Decode orchestration
- Decode driver
decode_ctx_vad_vtt.py
Audio preparation
- Audio discovery
chunk_audio.py - Load and resample
chunk_audio.py - Silero VAD
- Speech chunking
chunk_audio.py - Standalone chunk CLI
chunk_audio.py
Inference and text
- In-memory dataset
inmemory_speech_dataset.py - Configured dataset class
- Language prompt
conf/prompt_dynamic_language.yaml - Model factory
decode_ctx_vad_vtt.py - ASR model
- Text cleanup
decode_ctx_vad_vtt.py - Overlap deduplication
decode_ctx_vad_vtt.py
Outputs
- Merged transcript
decode_ctx_vad_vtt.py - Timed VTT cues
decode_ctx_vad_vtt.py - Chunk TSV
decode_ctx_vad_vtt.py - Chunk WAV files
chunk_audio.py
Other components
- Audio provider
Connections 21
- Audio provider → Decode driver: provides input
- Decode driver → Audio discovery: finds audio
- Decode driver → Model factory: loads once
- Model factory → ASR model: constructs
- Decode driver → Silero VAD: loads VAD
- Decode driver → Speech chunking: requests chunks
- Speech chunking → Load and resample: reads audio
- Speech chunking → Silero VAD: detects speech
- Audio discovery → Decode driver: returns files
- Decode driver → In-memory dataset: builds per chunk
- In-memory dataset → Configured dataset class: loads dynamically
- In-memory dataset → Language prompt: uses template
- Decode driver → ASR model: generates text
- Decode driver → Text cleanup: sanitizes output
- Decode driver → Overlap deduplication: deduplicates overlap
- Decode driver → Merged transcript: writes merged text
- Decode driver → Timed VTT cues: writes timed cues
- Decode driver → Chunk TSV: writes chunk records
- Audio provider → Standalone chunk CLI: supplies audio
- Standalone chunk CLI → Speech chunking: uses chunking
- Standalone chunk CLI → Chunk WAV files: writes WAV chunks