nomadkaraoke / python-audio-separator

Easy to use vocal separation from CLI or as a python package, using a variety of amazing pre-trained models (primarily from UVR)
MIT License
390 stars 63 forks source link

Support custom file names for primary and secondary stem #89

Open JackismyShephard opened 1 month ago

JackismyShephard commented 1 month 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 1 month 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 1 month 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 1 month 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 1 month ago

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