nomadkaraoke / python-audio-separator

Easy to use stem (e.g. instrumental/vocals) separation from CLI or as a python package, using a variety of amazing pre-trained models (primarily from UVR)
MIT License
502 stars 83 forks source link

Support custom file names for primary and secondary stem #89

Open JackismyShephard opened 4 months ago

JackismyShephard commented 4 months ago

I seem to recall this project supporting custom file names for primary and secondary stem in an earlier version, but it does not seem to be supported in the latest version (0.17.5). Would it be possible to bring that functionality back?

I am using this project as a python library for another project, which requires a specific naming scheme for output stems, so that functionality would be greatly appreciated.

beveradb commented 4 months ago

Hey, sorry, I ditched that functionality once I implemented support for models which output multiple stems and stems of different types as it was messy and hard to make it consistent.

The output from output_files = separator.separate(args.audio_file) should give you a list of filenames though so it should be easy to rename them to whatever you want in literally one more line of python code afterwards, e.g.

output_files = separator.separate(args.audio_file)
output_files[0].rename('instrumental.flac')
output_files[1].rename('vocals.flac')

Hope that's ok!

JackismyShephard commented 4 months ago

@beveradb Yes, that is more or less what I am doing now. Renaming manually is not a big problem, but being able to supply custom filenames to Separator.separate would still be a nice feature :blush:

JackismyShephard commented 4 months ago

@beveradb Also, great work on this project. I was looking for an interface to programmatically access the functionality of UVR and the abstractions in your API expose it in both a comprehensive and intuitive way. Also, I appreciate your thorough documentation (although perhaps there could be more type annotations in the source code)

beveradb commented 4 months ago

Glad you appreciate it, and understood! PRs very welcome for both file renaming and type hints 😉

hadiham commented 1 week ago

Hello @beveradb and @JackismyShephard ! My partner @RommyT1 and I are students at the University of Michigan, and we are taking a Software Engineering class that tasked us to contribute to an open source project and we would love to contribute to issue #89! We would appreciate it if you can assign the issue to us as we would love to implement this feature. We will make sure to review the project documentation and follow all the guidelines closely. Thank you for considering our request and we hope to be able to contribute soon!

beveradb commented 1 week ago

Think that was implemented in https://github.com/nomadkaraoke/python-audio-separator/pull/141 I'm afraid; but it's still not supported for demucs (more than 2 stem outputs) and there's basically no unit tests for anything so that would be appreciated if you're willing!

hadiham commented 5 days ago

Hi @beveradb

I appreciate the opportunity to work on this issue, however the current state of the issue does not align with our requirements and goals for our class assignment. Thank you!