在 python 中寻找读取音频波值

looking for reading audio wave values in python

我正在尝试读取和操作音频文件, 如何使用 python?

读取和操作波形文件的波形值

SciPy libraries 对此有很好的资源:

Writing and Reading:

import numpy as np
from scipy.io import wavfile

fs = 44.1e3
t = np.arange(0, 1.0, 1.0/fs)

f1 = 440
f2 = 600

x = 0.5*np.sin(2*np.pi*f1*t) + 0.5*np.sin(2*np.pi*f2*t)

fname = 'output.wav'
wavfile.write( fname, fs, x )


fs, data = wavfile.read( fname )

print fs, data[:10]

Documentation: http://docs.scipy.org/doc/scipy-0.14.0/reference/io.html#module-scipy.io.wavfile

这个问题之前有人问过:Reading *.wav files in Python