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

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

Open
ben-8878 opened this issue Apr 13, 2018 · 13 comments
Open

Comments

@ben-8878
Copy link

(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]]

@dodiku
Copy link
Owner

dodiku commented Apr 15, 2018

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

@marksims
Copy link

marksims commented May 4, 2018

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
Copy link

marksims commented May 4, 2018

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]]

@dodiku
Copy link
Owner

dodiku commented May 4, 2018

python version? I'm running Python 3.6.0.

@pobedyn
Copy link

pobedyn commented Jul 9, 2018

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

@pobedyn
Copy link

pobedyn commented Jul 9, 2018

Dodiku, what version of SoX are you using?

@dodiku
Copy link
Owner

dodiku commented Jul 11, 2018

this is what i'm getting:

$ sox --version
sox:      SoX v

@pobedyn
Copy link

pobedyn commented Jul 11, 2018

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.

@dodiku
Copy link
Owner

dodiku commented Jul 13, 2018

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.

@aakash30jan
Copy link

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

@dodiku
Copy link
Owner

dodiku commented Jul 19, 2018

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

@ghost
Copy link

ghost commented Jul 10, 2019

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.

@AmeeraMilibari
Copy link

@pobedyn worked with me too

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

6 participants