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

RuntimeWarning: invalid value encountered in divide #90

Closed
mukundt opened this issue Aug 21, 2023 · 1 comment
Closed

RuntimeWarning: invalid value encountered in divide #90

mukundt opened this issue Aug 21, 2023 · 1 comment

Comments

@mukundt
Copy link

mukundt commented Aug 21, 2023

Hey! Thanks again for creating this library :) I'm trying to use it to reduce background noise on 20ms chunks of streaming telephony audio before passing it to a voice activity detector.

To test it out, I ran the provided example code on a local wav file, but am getting the following error:

from scipy.io import wavfile
import noisereduce as nr
# load data
rate, data = wavfile.read("mywav.wav")
# perform noise reduction
reduced_noise = nr.reduce_noise(y=data, sr=rate)
wavfile.write("mywav_reduced_noise.wav", rate, reduced_noise)
noisereduce.py:306: RuntimeWarning: invalid value encountered in divide
  sig_mult_above_thresh = (abs_sig_stft - sig_stft_smooth) / sig_stft_smooth

Am I doing something wrong?

@mukundt mukundt closed this as completed Aug 21, 2023
@mukundt
Copy link
Author

mukundt commented Aug 21, 2023

Woops, I forgot to reshape the data as mentioned in #71

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

1 participant