This project sorts music files based on the detected language of the audio. It uses the Whisper model for language detection and organizes the files accordingly.
- Python 3.7+
- Required Python packages (listed in
requirements.txt
)
-
Clone the repository:
git clone <repository_url> cd Music sorter
-
Install the required packages:
pip install -r requirements.txt
-
Download the Whisper model:
whisper.download_model("large-v3", download_root="whisper_models")
-
Place your music files in the
Music
directory. -
Run the script to sort the music files:
python music_sorter.py
-
To move files based on the CSV results, set the
move_files_flag
toTrue
:move_files_flag = True
-
To reverse the file movement, set the
reverse_move_flag
toTrue
:reverse_move_flag = True
- Detects the language of audio files using the Whisper model.
- Organizes files into folders based on the detected language.
- Supports reversing the file movement.
- Provides progress tracking with
tqdm
. - Updates results in a CSV file.
The project uses a multi-agent approach to identify the language of the music files:
- Web Agent: Searches for the song language on the web and returns details from the web search.
- Language Parser Agent: Parses the language from the details provided by the Web Agent.
- Song Language Agent: Coordinates the Web Agent and Language Parser Agent to identify the language of the song. The language is returned in title case and is one of the following: English, Hindi, Japanese, or Other.
-
Ensure you have the required Python packages installed as mentioned in the Installation section.
-
Place your music files in the
Music
directory. -
Run the agent script to identify the language of the music files:
python music_sorter_ai_agent.py
-
The script will process the files and update the
language_identification_results.csv
file with the identified languages. -
To move files based on the CSV results, set the
move_files_flag
toTrue
in the script:move_files_flag = True
-
To reverse the file movement, set the
reverse_move_flag
toTrue
in the script:reverse_move_flag = True
- Ensure you have enough disk space for temporary files and the Whisper model.
- The script uses
torch
for model quantization to optimize performance.
This project is licensed under the MIT License.