ifile = wave.open("input.wav")
how can I write this file into a numpy float array now?
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
来源:https://stackoverflow.com/questions/16778878/python-write-a-wav-file-into-numpy-float-array