Demucs Acapella
demucs_acapella is a Python package that extracts vocals (acapella) from audio files using the Demucs model and embeds the key and BPM into the metadata of the output files.
Features
- Extracts vocals (acapella) from audio files.
- Automatically embeds the detected key and BPM into the metadata of the output files.
- Supports various audio formats including
.mp3,.wav, and.flac. - Can be used from the command line or as a Python package.
Installation
From PyPI
You can install the demucs_acapella package directly from PyPI:
pip install demucs_acapella
From Source
To install from source, clone the repository and install the dependencies:
git clone https://github.com/yourusername/demucs_acapella.git
cd demucs_acapella
pip install -r requirements.txt
Dependencies
demucs: For the deep learning model to extract vocals.pydub: For audio file manipulation.tinytag: For extracting BPM from audio files.eyed3: For modifying MP3 metadata.
You can install the necessary dependencies by running:
pip install -r requirements.txt
Usage
Command Line Interface (CLI)
To run the package and extract vocals from your audio files, use the following command:
demucs_acapella -i /path/to/input/folder -o /path/to/output/folder
Arguments
-i, --input: Path to the input directory containing audio files. It will recursively search for audio files.-o, --output: Path to the output directory where acapella files will be stored.
Example
demucs_acapella -i /path/to/your/audio/files -o /path/to/output/folder
This will:
- Extract vocals from the audio files found in
/path/to/your/audio/files. - Save the vocals in the
/path/to/output/folderdirectory, preserving the original folder structure.
Embedding Key and BPM Metadata
After the vocals are extracted, the script can automatically embed the key and BPM information into the metadata of the output files.
Running from Python Script
You can also use the package programmatically in your Python code:
from demucs_acapella import extract_vocals
input_file = '/path/to/audio/file.mp3'
output_folder = '/path/to/output/folder'
vocals_file = extract_vocals(input_file, output_folder)
if vocals_file:
print(f"Extracted vocals saved to {vocals_file}")
else:
print("Failed to extract vocals.")
Examples
Example 1: CLI extraction
Run the following command to extract acapella from an entire folder of audio files:
demucs_acapella -i /path/to/input/folder -o /path/to/output/folder
This will process all supported audio files (such as .mp3, .wav, and .flac) inside the input folder and save the extracted acapella versions in the output folder.
Example 2: Programmatic Usage
You can call extract_vocals from your Python script to extract vocals for a specific audio file:
from demucs_acapella import extract_vocals
vocals_file = extract_vocals('path/to/input/file.mp3', 'path/to/output/folder')
if vocals_file:
print(f"Vocals saved to {vocals_file}")
else:
print("Error extracting vocals.")
License
demucs_acapella is licensed under the MIT License. See the LICENSE file for more details.
Acknowledgements
- Demucs for the deep learning model to separate vocals.
- pydub for audio file manipulation.
- eyed3 for modifying MP3 metadata.
Contributing
Feel free to open an issue or submit a pull request if you'd like to contribute to this project.
Metadata
Release files for demucs-acapella 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| demucs_acapella-1.0.3.tar.gz | 5.0 kB | Without provenance | Details for demucs_acapella-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| demucs_acapella-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for demucs_acapella-1.0.3-py3-none-any.whl |
Total release size: 10.6 kB
Release files / demucs_acapella-1.0.3.tar.gz
| Download URL | demucs_acapella-1.0.3.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ccaec0abe849972d0e55427d913ab90056491c575239dd746e13d2d94733687c
|
|
BLAKE2b-256 checksum How to use checksums |
c11d394d00ca4f3c2baa4ea33aa83d112ecc72a97662dacd597ed8940289df89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.2
|
Release files / demucs_acapella-1.0.3-py3-none-any.whl
| Download URL | demucs_acapella-1.0.3-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5606aac0245b2a2bb84e6cc3fbc63a5f2b933e7cf52cda284859ff2387adf3c0
|
|
BLAKE2b-256 checksum How to use checksums |
67296f4515bf8b8a4b6e1fe548aff038e5efbb6fc07837be82d5db25ff373f9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.2
|
Security for demucs-acapella 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.