This project analyzes the audio being played on your computer, converts it into a MEL spectrogram, and uses a deep learning model to classify the music genre. Based on the detected genre, it sends a command to JamesDSP to adjust the music equalization according to the genre-specific profile.
If you want to know more about the reason for certain selected parameters of the Mel programs, please visit the following document.
- Audio Capture: Monitors and captures the audio being played on your computer.
- MEL Spectrogram Conversion: Converts the captured audio into a MEL spectrogram.
- Music Genre Classification: Utilizes a deep learning model to classify the genre of the audio.
- Automatic Equalization Adjustment: Sends commands to JamesDSP to adjust the equalization based on the detected music genre.
-
Clone the repository:
git clone https://github.com/yourusername/music-genre-classifier.git cd music-genre-classifier
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Start the main script to begin monitoring audio and adjusting equalization:
python main.py
-
The system will capture the audio, generate the MEL spectrogram, classify the music genre, and adjust the equalization in real-time.
data/
balance_dataset.py
: Balances the dataset for training.command_equalization.py
: Sends commands to JamesDSP for equalization adjustments.data_acquisition.py
: Captures audio being played on the computer.music_2_spectrogram.py
: Converts audio to MEL spectrogram.
model/
schedulers/
: Contains learning rate schedulers.architecture.py
: Defines the architecture of the deep learning model.inference.py
: Handles inference for genre classification.
main.py
: Main script to run the complete audio analysis and equalization adjustment flow.training.py
: Script for training the deep learning model.
Contributions are welcome. If you would like to contribute, please follow these steps:
- Fork the project.
- Create a new branch (
git checkout -b feature/new_feature
). - Make your changes and commit them (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/new_feature
). - Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
Thank you for using our automatic music genre classification and equalization system!