Get a sox_io error on ubuntu

I’ve got an error on ubuntu mute, it seems like there’s somthing to do with sox_io, can any body help me fix it?
code I tried to run:

from speechbrain.pretrained import EncoderDecoderASR

asr_model = EncoderDecoderASR.from_hparams(source=“speechbrain/asr-crdnn-rnnlm-librispeech”, savedir=“pretrained_model”)

audio_file = “/content/speechbrain/samples/audio_samples/example1.wav”

asr_model.transcribe_file(audio_file )

my error:
UserWarning: No audio backend is available.
warnings.warn(‘No audio backend is available.’)
Traceback (most recent call last):
File “test.py”, line 1, in
from speechbrain.pretrained import EncoderDecoderASR
File “/home/evonne/.local/lib/python3.8/site-packages/speechbrain/init.py”, line 4, in
from .core import Stage, Brain, create_experiment_directory, parse_arguments
File “/home/evonne/.local/lib/python3.8/site-packages/speechbrain/core.py”, line 32, in
from speechbrain.utils.distributed import run_on_main
File “/home/evonne/.local/lib/python3.8/site-packages/speechbrain/utils/init.py”, line 11, in
from . import * # noqa
File “/home/evonne/.local/lib/python3.8/site-packages/speechbrain/utils/Accuracy.py”, line 7, in
from speechbrain.dataio.dataio import length_to_mask
File “/home/evonne/.local/lib/python3.8/site-packages/speechbrain/dataio/init.py”, line 11, in
from . import * # noqa
File “/home/evonne/.local/lib/python3.8/site-packages/speechbrain/dataio/sampler.py”, line 21, in
from speechbrain.dataio.dataset import DynamicItemDataset
File “/home/evonne/.local/lib/python3.8/site-packages/speechbrain/dataio/dataset.py”, line 13, in
from speechbrain.dataio.dataio import load_data_json, load_data_csv
File “/home/evonne/.local/lib/python3.8/site-packages/speechbrain/dataio/dataio.py”, line 26, in
torchaudio.set_audio_backend(torchaudio_backend)
File “/home/evonne/.local/lib/python3.8/site-packages/torchaudio/backend/utils.py”, line 43, in set_audio_backend
raise RuntimeError(
RuntimeError: Backend “sox_io” is not one of available backends: [].

my os:
螢幕快照 2021-07-19 下午11.36.31

my packages:
Package Version


apturl 0.5.2
attrs 19.3.0
bcrypt 3.1.7
blinker 1.4
Brlapi 0.7.0
cajarename 19.7.15
certifi 2019.11.28
chardet 3.0.4
Click 7.0
colorama 0.4.3
command-not-found 0.3
configobj 5.0.6
cryptography 2.8
cupshelpers 1.0
dbus-python 1.2.16
defer 1.0.6
deja-dup-caja 0.0.6
distro 1.4.0
distro-info 0.23ubuntu1
duplicity 0.8.12.0
entrypoints 0.3
fasteners 0.14.1
filelock 3.0.12
folder-color-caja 0.0.86
folder-color-common 0.0.86
future 0.18.2
gpg 1.13.1-unknown
gpytorch 1.5.0
httplib2 0.14.0
huggingface-hub 0.0.14
HyperPyYAML 1.0.0
idna 2.8
importlib-metadata 1.5.0
Jinja2 2.10.1
joblib 1.0.1
jsonpatch 1.22
jsonpointer 2.0
jsonschema 3.2.0
keyring 18.0.1
language-selector 0.1
launchpadlib 1.10.13
lazr.restfulclient 0.14.2
lazr.uri 1.0.3
lockfile 0.12.2
logmmse 1.5
louis 3.12.0
Magnus 1.0.3
Mako 1.1.0
MarkupSafe 1.1.0
mate-hud 19.10.0
mate-menu 20.4.1
mate-tweak 20.4.0
monotonic 1.5
more-itertools 4.2.0
netifaces 0.10.4
numpy 1.21.0
oauthlib 3.1.0
olefile 0.46
onboard 1.4.1
packaging 21.0
paramiko 2.6.0
pexpect 4.6.0
Pillow 7.0.0
pip 20.0.2
psutil 5.5.1
pulsemixer 1.5.0
pycairo 1.16.2
pycrypto 2.6.1
pycups 1.9.73
PyGObject 3.36.0
PyJWT 1.7.1
pymacaroons 0.13.0
PyNaCl 1.3.0
pyOpenSSL 19.0.0
pyparsing 2.4.7
pyrsistent 0.15.5
pyserial 3.4
python-apt 2.0.0+ubuntu0.20.4.3
python-dateutil 2.7.3
python-debian 0.1.36ubuntu1
python-speech-features 0.6
python-xapp 1.8.1
python-xlib 0.23
pyxattr 0.6.1
pyxdg 0.26
PyYAML 5.3.1
reportlab 3.5.34
requests 2.22.0
requests-unixsocket 0.2.0
ruamel.yaml 0.17.10
ruamel.yaml.clib 0.2.6
scikit-learn 0.19.2
scipy 1.7.0
SecretStorage 2.3.1
sentencepiece 0.1.96
setproctitle 1.1.10
setuptools 45.2.0
simplejson 3.16.0
six 1.14.0
sox 1.4.1
speechbrain 0.5.9
ssh-import-id 5.10
systemd-python 234
threadpoolctl 2.2.0
torch 1.9.0
torchaudio 0.9.0
tqdm 4.61.2
typing-extensions 3.10.0.0
ubuntu-advantage-tools 20.3
ubuntu-drivers-common 0.0.0
ufw 0.36
unattended-upgrades 0.1
urllib3 1.25.8
wadllib 1.3.3
wheel 0.34.2
xkit 0.0.0
youtube-dl 2020.3.24
zipp 1.0.0

ps. It’s a little emergency, and I’m a new one at python, so please explain it as simple as possible, thanks

This is a Torchaudio issue. Please try to import torchaudio to see if the error occurs again. It is most likely that you need to install sox, then reinstall torch audio OR install torch audio within a condo env. python 3.x - cannot import torch audio ' No audio backend is available.' - Stack Overflow

Sorry, it’s my fault. i didn’t notice that I only put a part of the packages I installed.
I’ve already installed sox before and it didn’t help. Is there any other possible reasons that occurs this error?

I don’t really know as it is related to torchaudio :confused: Maybe try a fresh install with Anaconda so everything is well packaged.

Well, that was a nice suggestion, but unfortunately I also have problem installing anaconda on my ubuntu mate. I’m using raspberry pi 4 by the way.

Right … I only found:

Support for Raspberry pi? · Issue #631 · pytorch/audio · GitHub

I am not familiar with Rasp :confused: Maybe one solution, if you are not interested in training, would simply be to dockerize SpeechBrain. One student of mine did it quite easily).

Actually the function I need is speaker separation, for example if there’s an audio file and in the file there are three speakers talk in the same time, I want to separate the file into three different audio files.
And the three speakers are total stranger to the separation model. Is that possible using speechbrain to do that?

Yes, if they do speak at the same time, it becomes a bit harder though as you have different ways of handling this. Note: nothing will works perfectly out of the box, you will have to work a bit on that. It’s always the case with speech technologies :stuck_out_tongue:

my latest package list

absl-py 0.13.0
apturl 0.5.2
asciitree 0.3.3
attrs 19.3.0
audioread 2.1.9
backcall 0.2.0
bcrypt 3.1.7
blinker 1.4
Brlapi 0.7.0
cachetools 4.2.2
cajarename 19.7.15
certifi 2019.11.28
cffi 1.14.6
chardet 3.0.4
Click 7.0
colorama 0.4.3
command-not-found 0.3
configobj 5.0.6
cryptography 2.8
cupshelpers 1.0
cycler 0.10.0
dbus-python 1.2.16
decorator 5.0.9
defer 1.0.6
deja-dup-caja 0.0.6
distro 1.4.0
distro-info 0.23ubuntu1
duplicity 0.8.12.0
entrypoints 0.3
fasteners 0.14.1
ffmpeg-python 0.2.0
ffmpy 0.3.0
filelock 3.0.12
flatbuffers 2.0
folder-color-caja 0.0.86
folder-color-common 0.0.86
future 0.18.2
google-auth 1.33.0
google-auth-oauthlib 0.4.4
gpg 1.13.1-unknown
gpytorch 1.5.0
grpcio 1.38.1
httplib2 0.14.0
huggingface-hub 0.0.14
HyperPyYAML 1.0.0
idna 2.8
importlib-metadata 1.5.0
importlib-resources 5.2.0
ipython 7.25.0
ipython-genutils 0.2.0
jams 0.3.4
jedi 0.18.0
Jinja2 2.10.1
joblib 1.0.1
jsonpatch 1.22
jsonpointer 2.0
jsonschema 3.2.0
keyring 18.0.1
kiwisolver 1.3.1
language-selector 0.1
launchpadlib 1.10.13
lazr.restfulclient 0.14.2
lazr.uri 1.0.3
lockfile 0.12.2
logmmse 1.5
louis 3.12.0
Magnus 1.0.3
Mako 1.1.0
Markdown 3.3.4
MarkupSafe 1.1.0
mate-hud 19.10.0
mate-menu 20.4.1
mate-tweak 20.4.0
matplotlib 3.4.2
matplotlib-inline 0.1.2
mir-eval 0.6
monotonic 1.5
more-itertools 4.2.0
musdb 0.4.0
museval 0.4.0
netifaces 0.10.4
norbert 0.2.1
numcodecs 0.8.0
numpy 1.21.0
oauthlib 3.1.0
olefile 0.46
onboard 1.4.1
onnxruntime 1.8.1
packaging 21.0
pandas 1.3.0
paramiko 2.6.0
parso 0.8.2
pexpect 4.6.0
pickleshare 0.7.5
Pillow 7.0.0
pip 20.0.2
prompt-toolkit 3.0.19
protobuf 3.17.3
psutil 5.5.1
pulsemixer 1.5.0
pyaml 20.4.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycairo 1.16.2
pycparser 2.20
pycrypto 2.6.1
pycups 1.9.73
Pygments 2.9.0
PyGObject 3.36.0
PyJWT 1.7.1
pyloudnorm 0.1.0
pymacaroons 0.13.0
PyNaCl 1.3.0
pyOpenSSL 19.0.0
pyparsing 2.4.7
pyrsistent 0.15.5
pyserial 3.4
python-apt 2.0.0+ubuntu0.20.4.3
python-dateutil 2.7.3
python-debian 0.1.36ubuntu1
python-speech-features 0.6
python-xapp 1.8.1
python-xlib 0.23
pytorch-ignite 0.4.5
pytz 2021.1
pyxattr 0.6.1
pyxdg 0.26
PyYAML 5.3.1
reportlab 3.5.34
requests 2.22.0
requests-oauthlib 1.3.0
requests-unixsocket 0.2.0
rsa 4.7.2
ruamel.yaml 0.17.10
ruamel.yaml.clib 0.2.6
scikit-learn 0.19.2
scipy 1.7.0
SecretStorage 2.3.1
sentencepiece 0.1.96
setproctitle 1.1.10
setuptools 45.2.0
simplejson 3.16.0
six 1.14.0
sortedcontainers 2.4.0
SoundFile 0.10.3.post1
sox 1.4.1
speechbrain 0.5.9
ssh-import-id 5.10
stempeg 0.2.3
systemd-python 234
tensorboard 2.5.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.0
termtables 0.2.4
threadpoolctl 2.2.0
torch 1.9.0
torchaudio 0.9.0
tqdm 4.61.2
traitlets 5.0.5
typing-extensions 3.10.0.0
ubuntu-advantage-tools 20.3
ubuntu-drivers-common 0.0.0
ufw 0.36
unattended-upgrades 0.1
urllib3 1.25.8
wadllib 1.3.3
wcwidth 0.2.5
Werkzeug 2.0.1
wheel 0.34.2
xkit 0.0.0
youtube-dl 2020.3.24
zarr 2.8.3
zipp 3.5.0