Python: write a wav file into numpy float array

点点圈 提交于 2019-11-29 00:08:36
Joran Beasley
>>> from scipy.io.wavfile import read
>>> a = read("adios.wav")
>>> numpy.array(a[1],dtype=float)
array([ 128.,  128.,  128., ...,  128.,  128.,  128.])

typically it would be bytes which are then ints... here we just convert it to float type

you can read about read here https://docs.scipy.org/doc/scipy/reference/tutorial/io.html#module-scipy.io.wavfile

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!