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

Install error: No audio backend is available #12

Closed
DaemonAlchemist opened this issue Dec 16, 2022 · 8 comments · Fixed by #54
Closed

Install error: No audio backend is available #12

DaemonAlchemist opened this issue Dec 16, 2022 · 8 comments · Fixed by #54

Comments

@DaemonAlchemist
Copy link

The installation instructions do not contain information on how to install an audio backend for torch audio, so an error is thrown on startup if not audio backend is installed:

https://stackoverflow.com/questions/62543843/cannot-import-torch-audio-no-audio-backend-is-available

@batrlatom
Copy link

try this
apt install -y libav-tools

@jparmstr
Copy link

I needed to manually install Torch with the command from this website (https://pytorch.org/get-started/locally/) in the anaconda environment; the requirements.txt does not install it properly.

I also installed SoundFile (pip install soundfile) as described in that Stack Overflow link you posted.

@DaemonAlchemist
Copy link
Author

Sorry if I wasn't clear. I was able to figure out what dependencies were needed and install them myself. This issue is about adding that info to the installation instructions so other users wouldn't have to do that troubleshooting themselves.

@batrlatom
Copy link

would Dockerfile be fine for you? I am trying to do one

@jordanjalles
Copy link

I ran into this same error. I'd love if there's clear instructions to fix it.

@eran-sefirot
Copy link

I am seeing this warning when I start the flask server:
/opt/conda/envs/riffusion/lib/python3.9/site-packages/torchaudio/_internal/module_utils.py:99: UserWarning: Failed to import soundfile. 'soundfile' backend is not available.
warnings.warn("Failed to import soundfile. 'soundfile' backend is not available.")

however it seems like inference is successful - I still haven't verified that actual sounds are produced.

is this the same problem? can you please share how to remove this warning?

@mthrok
Copy link

mthrok commented Dec 29, 2022

I am seeing this warning when I start the flask server: /opt/conda/envs/riffusion/lib/python3.9/site-packages/torchaudio/_internal/module_utils.py:99: UserWarning: Failed to import soundfile. 'soundfile' backend is not available. warnings.warn("Failed to import soundfile. 'soundfile' backend is not available.")

however it seems like inference is successful - I still haven't verified that actual sounds are produced.

is this the same problem? can you please share how to remove this warning?

That most likely means you have soundfile python package installed, but the actual backing library libsndfile is not available.
You need to install it manually.

From: https://pysoundfile.readthedocs.io/en/latest/#installation

On Linux, you need to install libsndfile using your distribution’s package manager, for example sudo apt-get install libsndfile1.

hmartiro added a commit that referenced this issue Dec 29, 2022
Hopefully this allows the soundfile pip package to work, which provides
torchaudio with an audio backend.

Closes: #12

Topic: install_libsndfile
hmartiro added a commit that referenced this issue Dec 29, 2022
Hopefully this allows the soundfile pip package to work, which provides
torchaudio with an audio backend.

Closes: #12

Topic: install_libsndfile
@hmartiro
Copy link
Member

Thanks for the tip @mthrok ! I added libsndfile1 to the CI and it resolved the no audio backend warning. I also added it to the README and linked to this issue.

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

Successfully merging a pull request may close this issue.

7 participants