Replace:
/path/to/your/audiofile.mp3
with the path to your audio file./desired/output/folder
with your target directory for saving the stems.htdemucs
with your model of choice, if required.
-
Argument Building:
The script builds a list of command-line style arguments (including model name, device, output directory, and input file) to configure Demucs's separation process. -
Delegating the Separation:
The main separation work is carried out by a direct call to Demucs’ CLI function (demucs_separate_main
), which processes the input file based on the provided parameters. -
Stem Extraction and Saving:
After processing, the separated stems are saved as WAV files usingtorchaudio
patched withsoundfile
to ensure the files are correctly written.
Contributions are welcome! Feel free to open issues or submit pull requests if you have ideas or improvements.
- Fork the repository.
- Create a new branch for each feature or bug fix.
- Send a pull request describing your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
- Facebook Research Demucs for the separation framework.
- The open source community for their invaluable contributions.