How igmim-yassine/speech-training-recorder works
Project Type and Purpose
• This is a standalone, cross-platform desktop GUI application written in Python.
• Purpose: display randomized text prompts to the user, record dictated speech as WAV files, and log metadata in a TSV file.
File Structure
Top-level files and directories:
• recorder.py – main application entry point and controller logic
• audio.py – audio-capture and playback logic
• recorder.qml – GUI layout and bindings
• prompts/ – sample text prompt files
• requirements.txt – external Python library dependencies
README for Additional Insights
• External libraries (from requirements.txt): likely PySide2/PyQt5, sounddevice or pyaudio, etc.
• Usage: command-line args control prompts file, save directory, count, and length.
• Runtime behavior: load prompts → display in QML UI → user records audio → write WAV & TSV → allow playback or delete.
Main Components to Illustrate
a. User Interface Layer
– QML UI (recorder.qml) rendered by Python GUI framework (PySide2/PyQt5).
– Displays prompt text, record/play/delete buttons.
b. Application Controller
– recorder.py orchestrates:
• Loading prompts (from prompts/*.txt)
• Passing them to the UI
• Handling UI events (record, stop, play, delete)
• Invoking audio engine
• Writing metadata
c. Audio Engine
– audio.py encapsulates:
• Capturing audio from microphone
• Saving to .wav files
• Playing back existing recordings
d. Data Storage
– File System:
• prompts/*.txt (input)
• user-specified save directory:
– WAV files (recorded speech)
– recorder.tsv (metadata log)
e. External Dependencies
– Python runtime (3.x)
– GUI framework (PySide2/PyQt5)
– Audio backend (sounddevice, pyaudio, wave)
Relationships and Data Flows
• User → (UI) → Application Controller
• Controller → Prompt Loader → QML UI (prompts displayed)
• User clicks “Record” → Controller → Audio Engine → MIC → Controller
• Controller → File System (write .wav & TSV)
• User clicks “Play/Delete” → Controller → Audio Engine or File System
Architectural Patterns & Principles
– MVC-like separation:
• View: recorder.qml
• Controller: recorder.py
• Model/Services: audio.py, prompt loader, file I/O
– Single-process, event-driven GUI application
– Dependency inversion: controller depends on abstracted audio module
Checklist
[ ] Separation of concerns: UI, Controller, Services, Data Store
[ ] External dependencies noted (Python, PySide2, audio library)