How jossephcoder/asistente_voz_vosk works
Project Type and Purpose
• This is a standalone, offline Desktop Voice Assistant written in Python.
• It captures microphone audio, uses Vosk speech-to-text models to transcribe speech into text, parses commands, and executes OS actions or custom routines.
High-Level Architecture Components
a. User Interface (UI)
• Microphone input (via audio_py/microfono.py)
• Console/terminal output for status and feedback
b. Audio Processing Layer
• Audio capture and file buffering (grabar_voz.py)
• Optional real-time streaming (fase_beta/transcribir_voz_realtime.py)
• Preprocessing (packaging raw audio frames for transcription)
c. Speech Recognition Engine
• Vosk model loader and manager (modelos.py)
• Offline model files in modelos_voz/ (acoustic model, graph, i-vector configs)
• Transcription wrapper (transcribir_audio.py or transcribir_voz.py)
d. Command Dispatcher
• Dynamic command collector (recopilador_objetos.py)
• Command definitions (comandos/comandos_win.py)
• Matching transcribed text against registered commands
e. Action Executor
• OS-level calls (open apps, run scripts)
• Subprocess or os library invocations
f. Orchestration (Main)
• Entry point asistente_voz.py (initializes all modules, enters listen-process loop)
• Batch launcher asistente_vosk.bat (activates virtualenv, runs assistant)
Data Flow & Interactions
1. Microphone captures audio →
2. Audio Processing buffers and normalizes audio →
3. Speech Recognition Engine transcribes audio →
4. Transcribed text sent to Command Dispatcher →
5. Dispatcher invokes matching function in comandos_win.py →
6. Action Executor runs the OS command or custom logic →
7. Assistant outputs status/result to console (and optionally via speech)
Architectural Patterns & Principles
• Modular layering (separate audio, recognition, dispatch, execution)
• Plugin-style command registration (via recopilador_objetos.py)
• Single point of orchestration (asistente_voz.py)
• Offline-first design (all models and logic local)
Technologies and Frameworks
• Python 3.10+ with Virtualenv
• Vosk speech-to-text
• Native Windows commands (via subprocess/os library)
• Zip-packed model directory (modelos_voz/vosk-model-small-es-0.42)