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

sox: not found SoX could not be found! #32

Open
fmnbijbzq opened this issue May 28, 2021 · 8 comments
Open

sox: not found SoX could not be found! #32

fmnbijbzq opened this issue May 28, 2021 · 8 comments

Comments

@fmnbijbzq
Copy link

use:
pip install sox

result:
/bin/sh: 1: sox: not found
SoX could not be found!

If you do not have SoX, proceed here:
 - - - http://sox.sourceforge.net/ - - -

If you do (or think that you should) have SoX, double-check your
path variables.
@hagenw
Copy link
Member

hagenw commented May 28, 2021

sox requires that the actual sox library is installed in order to access the files, see https://pysox.readthedocs.io/en/latest/#installation for more details.

@fmnbijbzq
Copy link
Author

Thank you!
I have installed this library.The problem has been solved.
But,I use the code example:

import opensmile

smile = opensmile.Smile(
    feature_set=opensmile.FeatureSet.ComParE_2016,
    feature_level=opensmile.FeatureLevel.Functionals,
)
y = smile.process_file('audio.wav')

result:

Traceback (most recent call last):
  File "/home/anaconda3/envs/py36/lib/python3.6/site-packages/pandas/core/tools/timedeltas.py", line 123, in _validate_timedelta_unit
    return _unit_map[arg]
KeyError: 'sec'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/IMCOCAP/project/extract_fea.py", line 7, in <module>
    y = smile.process_file('/home/IMCOCAP/project/IEMOCAP_full_release/Session2/dialog/wav/Ses02F_impro01.wav')
  File "/home/anaconda3/envs/py36/lib/python3.6/site-packages/opensmile/core/audinterface.py", line 349, in process_file
    file, start=start, end=end, channel=channel,
  File "/home/anaconda3/envs/py36/lib/python3.6/site-packages/opensmile/core/audinterface.py", line 103, in process_file
    file, start=start, end=end, channel=channel,
  File "/home/anaconda3/envs/py36/lib/python3.6/site-packages/opensmile/core/audinterface.py", line 70, in _process_file
    file=file,
  File "/home/anaconda3/envs/py36/lib/python3.6/site-packages/opensmile/core/audinterface.py", line 188, in _process_signal
    signal.shape[-1] / sampling_rate, unit='sec'
  File "/home/anaconda3/envs/py36/lib/python3.6/site-packages/pandas/core/tools/timedeltas.py", line 65, in to_timedelta
    unit = _validate_timedelta_unit(unit)
  File "/home/anaconda3/envs/py36/lib/python3.6/site-packages/pandas/core/tools/timedeltas.py", line 127, in _validate_timedelta_unit
    raise ValueError("invalid timedelta unit {0} provided".format(arg))
ValueError: invalid timedelta unit sec provided

Process finished with exit code 1

sox requires that the actual sox library is installed in order to access the files, see https://pysox.readthedocs.io/en/latest/#installation for more details.

@frankenjoe
Copy link
Collaborator

frankenjoe commented Jun 7, 2021

@fmnbijbzq you have two options to solve the new problem:

  1. update pandas: pip install --upgrade pandas
  2. update audinterface: pip install --upgrade audinterface

@hagenw
Copy link
Member

hagenw commented Jun 7, 2021

@fmnbijbzq you have two options to solve the new problem:

  1. update pandas: pip install --upgrade pandas
  2. update audinterface: pip install --upgrade audinterface

I think we are not using audinterface here yet. Only the first solution will work at the moment.

@frankenjoe
Copy link
Collaborator

I think we are not using audinterface here yet. Only the first solution will work at the moment.

oh you are right, we actually didn't switch yet. I created #34.

@fmnbijbzq
Copy link
Author

Thank you!
I made it.

@fmnbijbzq you have two options to solve the new problem:

  1. update pandas: pip install --upgrade pandas
  2. update audinterface: pip install --upgrade audinterface

@fmnbijbzq you have two options to solve the new problem:

  1. update pandas: pip install --upgrade pandas
  2. update audinterface: pip install --upgrade audinterface

I think we are not using audinterface here yet. Only the first solution will work at the moment.

@yalcincenik
Copy link

yalcincenik commented Dec 4, 2023

Which OS you are studying for Sox? @frankenjoe If Windows, how you fixed it by installing source for Sox and import from Python?

@hagenw
Copy link
Member

hagenw commented Dec 5, 2023

The Python package sox is no longer a dependency of opensmile. If you are using WAV, FLAC, or OGG files there should be no reason to install sox. To support other formats you might need sox or ffmpeg. Under Windows you need to install those libraries yourself and make sure they are added to the PATH variable.

I don't have experience with actual Windows PCs, but here is an example how we installed sox on a Windows runner on Github using micromamba

https://github.com/audeering/audiofile/blob/40a07e3e45fa27d2fe2bbb67b1acdd5c446dd1ec/.github/workflows/test.yml#L40-L42

and choco to install ffmpeg:

https://github.com/audeering/audiofile/blob/40a07e3e45fa27d2fe2bbb67b1acdd5c446dd1ec/.github/workflows/test.yml#L62-L64

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

No branches or pull requests

4 participants