How muhammad-zeeshan-khan/speech-recognition-app works
Project type and purpose
• This is a standalone desktop GUI application (“Speech Recognition Application”) written in Python.
• Its primary function is to accept or record audio input, send it to AssemblyAI’s speech‐to‐text API, receive the transcript, then optionally generate subtitles, summaries, and play back audio with overlays in a Pygame‐based interface.
File structure
Top‐level layout:
• main.py – application entrypoint / orchestrator
• interface.py – GUI (view) built on pygame
• api_communication.py – external API client (AssemblyAI integration)
• transcription.py – logic for preparing audio and parsing transcripts
• summary.py – post‐processing logic (text summarization)
• subtitles.py – generates subtitle data for display
• audio_player.py – encapsulates audio playback in the GUI
• utils.py – shared helper functions (e.g., file I/O, data formatting)
• credits.py – static credits screen/content
• keys.txt – local storage of your AssemblyAI API key
• sra_flowchart.drawio – existing rough sketch of the flow
Extract insights from the README
• GUI built on Python (pygame v2.5.2)
• Uses AssemblyAI’s API for transcription
• API key must be placed in keys.txt
• Supports download, play, subtitle overlay, summary generation
Main components
A. User Interface Layer
• interface.py (main menu, recording/upload UI, subtitles overlay, credits)
• audio_player.py (playback controls)
B. Application Controller / Orchestrator
• main.py – initializes GUI, routes UI events to business modules
C. Business Logic Modules
• api_communication.py – sends/receives JSON to/from AssemblyAI REST endpoints
• transcription.py – preps raw audio, handles polling or webhooks for transcript
• summary.py – invokes text‐summarization routines (could be local or external)
• subtitles.py – builds time‐coded subtitle files (e.g., SRT)
D. Utilities
• utils.py – file management, config loading (reads keys.txt), logging
• credits.py – static data source for “About” section
E. External Service
• AssemblyAI REST API (external dependency)
F. Local Storage / Assets
• keys.txt (API key)
Relationships & data flow
1. User interacts with the UI (interface.py) →
2. main.py routes the action:
• Record or load audio file → passes path to transcription.py
• transcription.py calls api_communication.py → calls AssemblyAI API → returns transcript
• transcript forwarded to summary.py (optional) → generates summary
• transcript forwarded to subtitles.py → generates .srt data
• UI (interface.py) plus audio_player.py display and play audio with subtitles overlay
3. utils.py provides shared services (config, logging) throughout
Architectural patterns & design principles
• MVC-like separation:
• View: interface.py + audio_player.py
• Controller: main.py
• Model/Business Logic: transcription.py, summary.py, subtitles.py, api_communication.py
• Single‐process, event‐driven GUI
• Layered approach: UI → Orchestrator → Domain Modules → External Service