How jinzhou5042/whisper-audio-streaming works
Main Components
• Stream Executable (src/stream.cpp): This is the entry point of the application.
• Audio Management (src/audio_manager.cpp/hpp): Manages audio input capture and streaming.
• Transcription via Whisper (third_party/whisper.cpp): Contains the speech-to-text engine which processes audio data.
• Language Translation (src/translator.cpp/hpp): Provides support for translating recognized text when the GOOGLE_TRANSLATE_API_KEY is provided.
• Bluetooth / SimpleBLE (src/simpleble_test.cpp/hpp and third_party/simpleble): Likely used for testing or interfacing with BLE devices, possibly in the context of audio streaming.
• Additional Parameters / Configuration (src/params.cpp): Holds configuration parameters that may define behavior across the system.
File Structure and Build Configuration
• The presence of a top-level CMakeLists.txt and an additional one under src shows a structured, multi-directory CMake project.
Relationships and Data Flow
• The flow begins at the stream executable which initializes the Audio Manager.
• Audio Manager captures incoming audio data and passes it to whisper.cpp for speech-to-text processing.
• Once the transcription is obtained, if translation is enabled (by setting the GOOGLE_TRANSLATE_API_KEY), the output is sent to the Translator module.
• There might also be a pathway to the SimpleBLE test component for device interaction or additional testing.
Architectural Patterns & Design Principles
• Separation of Concerns: Each module (audio capture, transcription, translation) is isolated.
• Modularity: The use of third_party submodules (whisper.cpp and simpleble) keeps core functionality separate from external libraries.
• Configurability: The params and CMake configuration files indicate that the system is designed to be flexible and portable across different platforms (e.g., macOS and Ubuntu, as mentioned in the README).
• That every important configuration, such as dependency injection of the Google Translate API key or model downloads in whisper.cpp, is noted as part of the system configuration.