How ajshooting/nandemo-karaoke works
Main Components
• Audio Processing Module: Represented by the files in the src/audio folder. This module handles various tasks such as copying, downloading, playing, recording, and separating the audio signal.
• Graphical User Interface (GUI): Found in the src/gui directory. This component contains the main window (src/gui/main_window.py), UI layout files (ui/main_window.ui), and additional widgets (e.g., pitch_bar) which display real-time pitch and lyrics.
• Lyrics Processing Module: Located in src/lyrics, this part handles lyrics recognition (using Whisper) and searching functionality.
• Pitch Analysis Module: Located in src/pitch which performs pitch extraction and analysis.
• Main Application Orchestrator: The src/main.py file acts as the entry point, linking user interactions in the GUI to back-end audio, pitch, and lyrics processing.
• Testing Suite: The tests folder includes various tests (for similarity, spleeter, whisper, and youtube-dl) that validate the functionality of different modules.
Relationships and Interactions
• The User interacts with the GUI which serves as the primary interface.
• The GUI sends commands to the Audio Processing Module to start tasks such as recording, playing, or audio separation.
• Once the audio is processed, the Pitch Analysis Module extracts and analyzes the pitch information.
• In parallel, the Lyrics Processing Module listens for or retrieves the lyrics from the processed audio.
• The results from the Pitch and Lyrics modules are synchronized and displayed in the GUI, possibly using widgets like the pitch_bar.
• The main module (src/main.py) orchestrates these interactions and ensures that tasks happen in the correct order.
• Tests are designed to ensure that each module performs as expected.
Architectural Patterns and Design Principles
• Modular and Layered Architecture: The project cleanly separates functionality into different modules based on their domain (audio, GUI, lyrics, pitch).
• Separation of Concerns: Each module (GUI vs. audio processing vs. pitch analysis) is self-contained and communicates through clearly defined interfaces.
• Integration of External Libraries: Note the dependencies on Spleeter for audio separation, Whisper for lyrics recognition, and YIN for pitch detection. Represent these as external services or libraries that the internal modules use.
• Testing as a Core Design Aspect: The presence of tests for each main functionality indicates an emphasis on reliability and independent verification of components.