主动降噪python_尝试使用Pyadi主动降噪时遇到错误

我从here得到这个代码。当我尝试在Python上运行它时(我使用的是Python 3.6),它遇到了以下错误:runfile('C:/Users/vsecadesang/Desktop/5th year/2nd sem/SIGNLAB/PROJECT/SIGNLABPROJ.py', wdir='C:/Users/vsecadesang/Desktop/5th year/2nd sem/SIGNLAB/PROJECT')

* recording

C:/Users/vsecadesang/Desktop/5th year/2nd sem/SIGNLAB/PROJECT/SIGNLABPROJ.py:75: RuntimeWarning: invalid value encountered in true_divide

obj = np.real(np.dot(avg_freq_buffer[1:51], np.abs(freq_synth[1:100:2])) / np.dot(freq_synth[1:100:2], np.conj(freq_synth[1:100:2])))

C:/Users/vsecadesang/Desktop/5th year/2nd sem/SIGNLAB/PROJECT/SIGNLABPROJ.py:76: RuntimeWarning: invalid value encountered in greater

if obj > obj_last:

Traceback (most recent call last):

File "", line 1, in

runfile('C:/Users/vsecadesang/Desktop/5th year/2nd sem/SIGNLAB/PROJECT/SIGNLABPROJ.py', wdir='C:/Users/vsecadesang/Desktop/5th year/2nd sem/SIGNLAB/PROJECT')

File "C:\Users\vsecadesang\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 880, in runfile

execfile(filename, namespace)

File "C:\Users\vsecadesang\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile

exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/vsecadesang/Desktop/5th year/2nd sem/SIGNLAB/PROJECT/SIGNLABPROJ.py", line 99, in

stream.write(string_audio_data, CHUNK)

File "C:\Users\vsecadesang\Anaconda3\lib\site-packages\pyaudio.py", line 586, in write

exception_on_underflow)

KeyboardInterrupt

我不知道到底怎么了,请帮忙。代码如下:

^{pr2}$

你可能感兴趣的:(主动降噪python)