How rajipilipia/ecoute works
Main Components
• Audio Input/Output Handling – Here you have separate modules for recording audio (AudioRecorder.py) and transcribing it (AudioTranscriber.py). This component is responsible for capturing live audio streams.
• Speech Recognition Engine – The custom_speech_recognition package plays a key role. Its submodules (e.g., audio.py, exceptions.py) as well as the recognizers folder (containing, for example, whisper.py) indicate distinct implementations for transcription.
• Model Management – TranscriberModels.py and the tiny.en.pt file indicate that different transcription models (local “tiny” model or external Whisper API) can be selected.
• External Dependencies – Integration with FFmpeg for audio processing and the optional connection to the OpenAI Whisper API (enabled via the --api flag) should be highlighted.
• Configuration & Environment – Files like requirements.txt and keys.py (created by the user) manage dependencies and runtime configurations (e.g., API keys).
Relationships and Data Flow
• From main.py, the program calls upon the Audio Input handler to record both microphone and speaker audio.
• The captured audio is passed to the transcription engine, which has two different processing paths:
• Local Processing using the provided “tiny” Whisper model (tiny.en.pt), for low resource consumption.
• API Processing via the OpenAI Whisper API (triggered by the --api flag) for faster, more accurate, and multi-language support.
• The custom_speech_recognition package serves as a middleware layer that standardizes how audio is processed and how recognizers (including the custom whisper recognizer) are called.
• Error handling is provided by defined exceptions within the package.
• Finally, the transcription text gets output (presumably into the UI textbox as described in the README) where users can view real-time transcriptions.
Architectural Patterns & Design Principles
• Modularity: Separation of concerns is clear – recording, transcription, model selection, and error management are decoupled into different modules.
• Adapter/Strategy Pattern: The usage of different transcription backends (local ASR model vs. the Whisper API) suggests an adaptable design where switching or upgrading models does not affect other parts of the system.
• Extensibility: The custom_speech_recognition package is structured to allow future additions (e.g., more recognizers or multi-language capabilities).