opensmile-python icon indicating copy to clipboard operation
opensmile-python copied to clipboard

sox: not found SoX could not be found!

Open fmnbijbzq opened this issue 4 years ago • 8 comments

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.

fmnbijbzq avatar May 28 '21 09:05 fmnbijbzq

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.

hagenw avatar May 28 '21 09:05 hagenw

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.

fmnbijbzq avatar May 29 '21 07:05 fmnbijbzq

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

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

frankenjoe avatar Jun 07 '21 09:06 frankenjoe

@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.

hagenw avatar Jun 07 '21 09:06 hagenw

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 https://github.com/audeering/opensmile-python/issues/34.

frankenjoe avatar Jun 07 '21 10:06 frankenjoe

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.

fmnbijbzq avatar Jun 08 '21 06:06 fmnbijbzq

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

yalcincenik avatar Dec 04 '23 20:12 yalcincenik

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

hagenw avatar Dec 05 '23 08:12 hagenw