Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: "Could not load file test.mp3. Maybe it is not a supported file format? Error is No audio I/O backend is available.." #169

Closed
vitacon opened this issue Apr 29, 2021 · 7 comments
Labels
question Further information is requested

Comments

@vitacon
Copy link

vitacon commented Apr 29, 2021

❓ Questions

Windows 10 64, Anaconda 3.7
The previous version worked fine for me but I can't make the latest version run. =(

python.exe -m pip install -U demucs

This seems to pass successfully: "Successfully installed demucs-2.0.0 diffq-0.1.0 julius-0.2.3 lameenc-1.3.1 torch-1.8.1 torchaudio-0.8.1 typing-extensions-3.7.4.3"

python.exe -m demucs.separate -d cpu test.mp3

C:\Users\Vita\Anaconda3\lib\site-packages\torchaudio\extension\extension.py:13: UserWarning: torchaudio C++ extension is not available.
warnings.warn('torchaudio C++ extension is not available.')
C:\Users\Vita\Anaconda3\lib\site-packages\torchaudio\backend\utils.py:89: UserWarning: No audio backend is available.
warnings.warn('No audio backend is available.')
Separated tracks will be stored in C:\Users\Vita\music-separation\demucs2021\separated\demucs_quantized
Separating track test.mp3
Could not load file test.mp3. Maybe it is not a supported file format? Error is No audio I/O backend is available..

I get the same error message with other files (mp3 or wav) and/or full path too. Any suggestions what's wrong? Do the warnings matter? (The previous version of demucs does not display any.)

@vitacon vitacon added the question Further information is requested label Apr 29, 2021
@adefossez
Copy link
Contributor

adefossez commented Apr 29, 2021

Hey, @vitacon , sorry I didn't verify torchaudio was properly supported on Windows. I just pushed a fix that should help, also updated instructions. If you have ffmpeg installed, it should work (you can run conda install ffmpeg otherwise).

If you can pull from master, try again and let me know if that works ?

@vitacon
Copy link
Author

vitacon commented Apr 30, 2021

Thanks for taking care of it. =) However it's not working yet.

I use two different computers. On the first one with Anaconda 3.7 conda install ffmpeg reported some conflict and after two hours of searching for a holy grail it still reported that ffmpeg is missing. Of course, that's some kind of Python issue that will require more time to investigate it.

The second computer includes a fresh installation of Anaconda 3.8 and conda install ffmpeg passed within a few seconds. Unfortunately it still does not save any result:

(base) C:\Users\condak\audio-separation\demucs-master>python.exe -m demucs.separate -d cpu test.mp3
C:\Users\condak\Anaconda3\lib\site-packages\torchaudio\extension\extension.py:13: UserWarning: torchaudio C++ extension is not available.
  warnings.warn('torchaudio C++ extension is not available.')
C:\Users\condak\Anaconda3\lib\site-packages\torchaudio\backend\utils.py:89: UserWarning: No audio backend is available.
  warnings.warn('No audio backend is available.')
Separated tracks will be stored in C:\Users\condak\audio-separation\demucs-master\separated\demucs_quantized
Separating track test.mp3
  0%|                                                                                   | 0.0/30.0 [00:00<?, ?seconds/s]100%|██████████████████████████████████████████████████████████████████████████| 30.0/30.0 [00:13<00:00,  2.16seconds/s]100%|██████████████████████████████████████████████████████████████████████████| 30.0/30.0 [00:13<00:00,  2.16seconds/s]
Traceback (most recent call last):
  File "C:\Users\condak\Anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\condak\Anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\condak\audio-separation\demucs-master\demucs\separate.py", line 183, in <module>
    main()
  File "C:\Users\condak\audio-separation\demucs-master\demucs\separate.py", line 179, in main
    ta.save(wavname, source, sample_rate=model.samplerate)

I.e. the separation process seemed to pass but it crashed while trying to save the separated files.
It seems to me you should add some verification to saving too...?

By the way, I just don't quite understand why did you change the way the audio files are handled...? I had no problems with it with the previous version. Should it support more formats now?

@adefossez
Copy link
Contributor

I changed it mostly to reduce the number of dependencies, and in particular allow for using Demucs directly with pip install. Which works great on Linux and Mac, but on Windows things turned out to be a lot more problematic.

As a temporary fix, you should still be able to save as mp3s files with the --mp3 flag. I will push a fix today for saving wavs.

@adefossez
Copy link
Contributor

Doing pip install soundfile should fix the issue :)

@adefossez
Copy link
Contributor

Sorry for the disturbance! It is really hard to support properly all OSes.

@vitacon
Copy link
Author

vitacon commented Apr 30, 2021

I changed it mostly to reduce the number of dependencies,

I see.

Sorry for the disturbance! It is really hard to support properly all OSes.

I totally understand that.

As a temporary fix, you should still be able to save as mp3s files with the --mp3 flag.

It's a nice paradox but it really worked! =)

Doing pip install soundfile should fix the issue :)

And it really does! The installation even did not take 2 hour ;) and saving to .wav works now.

Thanks a lot! =)

@five42032
Copy link

Doing pip install soundfile should fix the issue :)

me also facing similar issue, thanks a lot, it really worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants