Currently filenames and extensions are split by simply cutting off the final four characters: audio.wav -> [audio][.wav]
That works great if you have a three character extension, but causes problems otherwise. For example if you're trying to diarise a .opus file (like I was), demucs will split the filename correctly, but diarize.py will split audio.opus -> [audio.][opus] and go looking for temp_outputs/htdemucs/audio./vocals.wav, which won't exist! This was slightly frustrating to figure out :)
Python's stdlib has a built in function os.path.splitext for doing this robustly, and I make here a pull request suggesting the simplest change.
Currently filenames and extensions are split by simply cutting off the final four characters:
audio.wav -> [audio][.wav]
That works great if you have a three character extension, but causes problems otherwise. For example if you're trying to diarise a .opus file (like I was), demucs will split the filename correctly, but diarize.py will split
audio.opus -> [audio.][opus]
and go looking fortemp_outputs/htdemucs/audio./vocals.wav
, which won't exist! This was slightly frustrating to figure out :)Python's stdlib has a built in function
os.path.splitext
for doing this robustly, and I make here a pull request suggesting the simplest change.