{"id":24987783,"url":"https://github.com/rerichardjr/dj_pyle","last_synced_at":"2026-05-05T05:35:38.641Z","repository":{"id":275645060,"uuid":"926692682","full_name":"rerichardjr/dj_pyle","owner":"rerichardjr","description":"DJ Pyle utilizes generative AI with LangChain and Huggingface's API to automate metadata-driven audio prompt generation, converting descriptive text to speech via ElevenLabs, creating a bumper track for album identification during playback.","archived":false,"fork":false,"pushed_at":"2025-02-03T19:54:18.000Z","size":295,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T20:25:20.580Z","etag":null,"topics":["elevenlabs","generative-ai","huggingface","langchain","langchain-python","python"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rerichardjr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-03T17:45:08.000Z","updated_at":"2025-02-03T19:54:21.000Z","dependencies_parsed_at":"2025-02-03T20:25:37.575Z","dependency_job_id":"64611b28-310e-4664-8cfb-ac5e521f1197","html_url":"https://github.com/rerichardjr/dj_pyle","commit_stats":null,"previous_names":["rerichardjr/dj_pyle"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rerichardjr%2Fdj_pyle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rerichardjr%2Fdj_pyle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rerichardjr%2Fdj_pyle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rerichardjr%2Fdj_pyle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rerichardjr","download_url":"https://codeload.github.com/rerichardjr/dj_pyle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246174607,"owners_count":20735417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elevenlabs","generative-ai","huggingface","langchain","langchain-python","python"],"created_at":"2025-02-04T11:55:55.059Z","updated_at":"2026-05-05T05:35:33.607Z","avatar_url":"https://github.com/rerichardjr.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# DJ Pyle\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n  \u003cimg src=\"assets/images/dj_pyle_logo.png\" alt=\"DJ Pyle Logo\"\u003e\r\n\u003c/div\u003e\r\n\r\nDJ Pyle is a Python application designed to combine individual MP3 tracks into a single full album MP3. This is specifically tailored for use with the [Pyle PBMSPG1BK](https://pyleusa.com/products/pbmspg1bk) MP3 player, which lacks a navigation menu and relies solely on forward and back buttons. By merging tracks into one continuous album file, the app reduces the need for excessive button presses. Additionally, DJ Pyle generates an introduction MP3, providing album details to the listener before the music starts.\r\n\r\n## Summary\r\n\r\nDJ Pyle reads metadata tags from individual MP3 files (artist, album, year) and creates an introduction prompt using a Radio DJ persona. This prompt is processed using LangChain to interact with Huggingface's API, generating an introduction to be used as a bumper track for artist and album indentification. The output is then converted to speech using ElevenLabs and saved as an MP3 file. Finally, the introduction and individual tracks are merged into a single MP3 for seamless playback.\r\n\r\n### Storage Efficiency\r\n\r\n| **Type of MP3**        | **Average File Size** | **Approximate Number on 16GB SD Card** |\r\n|------------------------|-----------------------|-----------------------------------------|\r\n| Individual MP3 (5 MB)  | 5 MB                  | ~3,200 files                            |\r\n| Full Album MP3 (100 MB)| 100 MB                | ~160 albums                             |\r\n\r\n*Note: These estimates vary based on bitrates and track lengths.*\r\n\r\n## Example output\r\n\r\n🤖 LLM response\r\n\r\nHey headbangers. I'm DJ Pyle on Pure Metal 1 O 1 .9 FM. Next track takes us back to the heart of thrash metal: it's the legendary 1986 release - Metallica's iconic masterpiece, Master of Puppets! Crank it up!\r\n\r\n🎧 [Listen to an Example Introduction MP3](https://soundcloud.com/drahcirer/dj-pyle-intro?si=dcf41b01e17b49f29da22083427529ea\u0026utm_source=clipboard\u0026utm_medium=text\u0026utm_campaign=social_sharing)\r\n\r\n## Features\r\n- Basic pronunciation adjustment of words in LLM responses using exact or fuzzy matching.\r\n- Emoji removal in LLM response.\r\n\r\n*Note: The LLM prompt explicity states no emojis in response.*\r\n\r\n## Setting Up the Environment\r\n\r\n### 1. **Create a Virtual Environment:**\r\n   ```bash\r\n   python -m venv venv\r\n   ```\r\n\r\n### 2. **Activate the Virtual Environment:**\r\n   - **Windows:**\r\n     ```bash\r\n     venv\\Scripts\\activate\r\n     ```\r\n   - **macOS/Linux:**\r\n     ```bash\r\n     source venv/bin/activate\r\n     ```\r\n\r\n### 3. **Install Required Packages:**\r\n   ```bash\r\n   pip install -r requirements.txt\r\n   ```\r\n\r\n\r\n## API Keys Configuration\r\n\r\nYou will need API keys for both HuggingFace and ElevenLabs:\r\n\r\n1. Sign up and obtain your API keys from [HuggingFace](https://huggingface.co) and [ElevenLabs](https://elevenlabs.io).\r\n2. Create a `.env` file in the project root:\r\n\r\n```env\r\nHUGGINGFACE_API_KEY=your_huggingface_api_key\r\nELEVENLABS_API_KEY=your_elevenlabs_api_key\r\n```\r\n\r\n## Installing ffmpeg and ffprobe\r\n\r\nDJ Pyle relies on `pydub`, which requires `ffmpeg` and `ffprobe`.\r\n\r\n### Windows:\r\n- Download from [FFmpeg website](https://ffmpeg.org/download.html).\r\n- Add the `bin` folder to your system's PATH.\r\n\r\n### macOS (using Homebrew):\r\n```bash\r\nbrew install ffmpeg\r\n```\r\n\r\n### Linux (Debian/Ubuntu):\r\n```bash\r\nsudo apt update\r\nsudo apt install ffmpeg\r\n```\r\n\r\n## Running the Application\r\n\r\nUse the CLI to process your MP3 files:\r\n\r\n```bash\r\npython main.py /path/to/your/mp3/directory\r\n```\r\n\r\n## CLI Arguments\r\n\r\nThe DJ Pyle application supports the following command-line arguments:\r\n\r\n### Required Argument:\r\n- `directory` (str):  \r\n  The path to the directory containing MP3 files. This argument is required to specify the location of the music files for processing.\r\n\r\n### Optional Arguments:\r\n- `--tgen`  \r\n  Run only the **Text Generation** process. This option generates text based on the metadata of the MP3 files without generating the corresponding speech or merging the tracks.\r\n\r\n- `--tts`  \r\n  Run both **Text Generation** and **Text-to-Speech** processes. This option generates the descriptive text and converts it to speech, providing an audio intro to be merged with the MP3 files.\r\n\r\n### Example Usage:\r\n```bash\r\npython main.py /path/to/mp3/directory\r\npython main.py /path/to/mp3/directory --tgen\r\npython main.py /path/to/mp3/directory --tts\r\n```\r\n---\r\n\r\n## Future Enhancements  \r\n\r\n- Add more CLI arguments for customization.  \r\n- Improve pronunciation correction for artist and album names.  \r\n- Support batch processing for multiple albums.\r\n- Improve error handling.\r\n- Album lookup using Musicbrainz when MP3s are not tagged. \r\n\r\n---\r\n\r\nEnjoy seamless album playback with DJ Pyle! 🤘\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frerichardjr%2Fdj_pyle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frerichardjr%2Fdj_pyle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frerichardjr%2Fdj_pyle/lists"}