How vinodkanchi/audio-player-system works
Project Type and Purpose
• This is a standalone C++ audio player application with MySQL-based storage for filter parameters and sound metadata.
• It follows an object-oriented, layered architecture, leveraging Eclipse IDE, UML concepts, and MATLAB scripts to generate filter data.
High-Level Component Identification
a. User Interface Layer
• CUserInterface – console or GUI interaction
• Main (main.cpp) – application entry point, instantiates and wires components
b. Controller Layer
• CAudioPlayerController – orchestrates playback, user commands, filter application
c. Audio I/O & Processing Layer
• CSimpleAudioOutStream – low-level audio output stream interface
• CPlayerIOCtrls – playback controls (play, pause, stop, seek)
• CAmpMeter – measures audio levels in real time
• CFilter – applies filter coefficients to audio stream
d. Data Access Layer
• CDatabase – generic MySQL connection/CRUD wrapper
• CAudiofiltersDb – retrieves and stores filter coefficient data
• CSoundCollectionDB – manages sound library metadata in MySQL
e. File System & Assets
• CFile – file I/O abstraction for reading .wav and .txt filter data
• Sounds/ – directory of WAV files and PDFs
• files/ – precomputed filter data in text format
• MATLABfilters/ – scripts to generate filter parameters
f. Exception Handling
• CASDDException – custom exception hierarchy for error handling
Component Relationships and Data Flows
• User → CUserInterface → CAudioPlayerController
• CAudioPlayerController:
• reads sound list via CSoundCollectionDB (via CDatabase)
• loads filter coefficients via CAudiofiltersDb
• opens audio via CFile → CSimpleAudioOutStream
• registers CPlayerIOCtrls for user control events
• applies filters (CFilter) and measures levels (CAmpMeter)
• All DB access flows through CDatabase to the MySQL server
• MATLAB scripts generate .txt files consumed by CAudiofiltersDb at runtime
Architectural Patterns and Principles
• Layered architecture separating UI, business logic, data access, and I/O
• Single Responsibility Principle: each class has one area of concern
• Dependency inversion: high-level controller depends on abstracted I/O and DB layers
• Use of factory or builder patterns (implied in how filters are loaded)
2. Inside it, partition into four horizontal layers:
– UI Layer at top (CUserInterface, main)
– Controller Layer (CAudioPlayerController)
– Processing Layer (CFilter, CSimpleAudioOutStream, CPlayerIOCtrls, CAmpMeter)
– Data Access Layer (CDatabase, CAudiofiltersDb, CSoundCollectionDB, CFile)
– MATLAB Runtime (rectangle) indicating scripts that produce filter data
– UI → Controller (user commands)
– Controller → Processing (playback, filter, level meter)
– Controller → Data Access (load sound list, filter data)
– Data Access → MySQL (SQL queries)
– File I/O component → Filesystem (read .wav, .txt)
– MATLAB → Filesystem (write filter files)