noise_reduction icon indicating copy to clipboard operation
noise_reduction copied to clipboard

when I run noise.py, met follows problem, can help find some causes?

Open ben-8543 opened this issue 7 years ago • 13 comments

(py3virtualenv) [root@node1 noise_reduction]# python noise.py Traceback (most recent call last): File "noise.py", line 230, in y_reduced_centroid_s = reduce_noise_centroid_s(y, sr) File "noise.py", line 64, in reduce_noise_centroid_s y_cleaned = less_noise(y) File "/home/yunbin.zhang/virtualenvs/py3virtualenv/lib/python3.6/site-packages/pysndfx/d sp.py", line 276, in call raise RuntimeError(stderr.decode()) RuntimeError: sox FAIL bass: usage: gain [frequency(100) width[s|h|k|q|o]]

ben-8543 avatar Apr 13 '18 07:04 ben-8543

Hi, I cannot reproduce this issue on my machine. It looks like an environment issue. Could be a the version of six or pysndfx. Maybe the following information will help:

  1. Did you installed requirements.txt -- $ pip install -r requirements.txt or $ pip3 install -r requirements.txt ?
  2. Can you paste your own virtualenv requirements.txt (using $ pip freeze > requiremenets.txt)?

Your virtualenv requirements file should look like this:

appdirs==1.4.3
audioread==2.1.4
Cython==0.25.2
decorator==4.0.11
joblib==0.11
librosa==0.5.0
numpy==1.12.1
packaging==16.8
pyparsing==2.2.0
pysndfx==0.1.0
python-speech-features==0.5
resampy==0.1.5
scikit-learn==0.18.1
scipy==0.19.0
six==1.10.0

dodiku avatar Apr 15 '18 05:04 dodiku

same problem here: centos 7, sox 14.4.1 what's your sox version? appdirs==1.4.3 audioread==2.1.4 Cython==0.25.2 decorator==4.0.11 joblib==0.11 librosa==0.5.0 numpy==1.12.1 packaging==16.8 pyparsing==2.2.0 pysndfx==0.1.0 python-speech-features==0.5 resampy==0.1.5 scikit-learn==0.18.1 scipy==0.19.0 six==1.10.0

marksims avatar May 04 '18 04:05 marksims

upgrade to sox 14.4.2 still got error

File "noise/lib/python2.7/site-packages/pysndfx/dsp.py", line 276, in call raise RuntimeError(stderr.decode()) RuntimeError: sox FAIL bass: usage: gain [frequency(100) width[s|h|k|q|o]]

marksims avatar May 04 '18 04:05 marksims

python version? I'm running Python 3.6.0.

dodiku avatar May 04 '18 18:05 dodiku

I'm getting the same error. Is it any solutions available? Python version 3.6.0

pobedyn avatar Jul 09 '18 11:07 pobedyn

Dodiku, what version of SoX are you using?

pobedyn avatar Jul 09 '18 11:07 pobedyn

this is what i'm getting:

$ sox --version
sox:      SoX v

dodiku avatar Jul 11 '18 03:07 dodiku

hm, it's strange. That's my output:

sox --version
sox:      SoX v14.4.2

Also I found out that this error message caused by functions reduce_noise_centroid_s and reduce_noise_centroid_mb, where threshold_l has a zero value, but if set value threshold_l for example 100 this error message are not shown.

pobedyn avatar Jul 11 '18 08:07 pobedyn

Oh, great! Thanks for the update.

Feel free to send a pull request with an update for the documentation (in the readme or in the code), or to handle this error in the code.

Let me know if this issue can be closed.

dodiku avatar Jul 13 '18 00:07 dodiku

@pobedyn your solution worked for me, thanks. I set the value of threshold_l = 1E-08 in reduce_noise_centroid_s( ) and reduce_noise_centroid_mb( ). But @dodiku , I think there should be some better fix to this issue as threshold_l may not always be close to zero.

aakash30jan avatar Jul 18 '18 23:07 aakash30jan

@aakash30jan yeah, I agree. Would you like to edit the code and send a pull request?

dodiku avatar Jul 19 '18 19:07 dodiku

I had the same problem as above. From a disc that failed, it became unavailable for recording, after repairing the disc, the audio file takes almost 3 hours of lecture. Tried to remove the noise. The computer hung up after a minute of the script. I had an idea to break 3 hours by 10 minutes ffmpeg. The first two files were cleared, and the rest did not want and gave an error, which is higher. Then the files that were not cleaned, I opened in Audacity and just saved with a slightly lower data transfer rate, it was 112, I saved it in 96 with a constant data transfer rate. The file itself was recorded on a dictaphone with two microphones. The right and left channels were different. In the right was the noise next to the recorder, and in the left channel there was a more distant noise. As a result, not all files worked, but most of them managed to be cleared of noise. The problem here is not in the script, but in the file itself, in the players, this audio file is played normally. Sorry for the English translator Google translator.

ghost avatar Jul 10 '19 20:07 ghost

@pobedyn worked with me too

AmeeraMilibari avatar Feb 24 '20 10:02 AmeeraMilibari