Have you tried the wave module? It has fewer dependencies:
http://docs.python.org/library/wave.html
def everyOther (v, offset=0):
return [v[i] for i in range(offset, len(v), 2)]
def wavLoad (fname):
wav = wave.open (fname, "r")
(nchannels, sampwidth, framerate, nframes, comptype, compname) = wav.getparams ()
frames = wav.readframes (nframes * nchannels)
out = struct.unpack_from ("%dh" % nframes * nchannels, frames)
# Convert 2 channles to numpy arrays
if nchannels == 2:
left = array (list (everyOther (out, 0)))
right = array (list (everyOther (out, 1)))
else:
left = array (out)
right = left
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…