我想使用scipy读取.wav文件。我这样做:scipy.io.wavfile给出“WavFileWarning:块不明白”错误
from scipy.io import wavfile
filename = "myWavFile.wav"
print "Processing " + filename
samples = wavfile.read(filename)
而且我得到这个丑陋的错误:
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/io/wavfile.py:121: WavFileWarning: chunk not understood
warnings.warn("chunk not understood", WavFileWarning)
Traceback (most recent call last):
File "fingerFooler.py", line 15, in <module>
samples = wavfile.read(filename)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/io/wavfile.py", line 127, in read
size = struct.unpack(fmt, data)[0]
struct.error: unpack requires a string argument of length 4
我使用Python 2.6.6,1.6.2 numpy的和SciPy的0.11.0
Here's一导致问题的wav文件。
有什么想法?这里有什么问题?
尝试'samples = wavfile.read(打开(文件名,'r'))' – Skyler
试过了,仍然有同样的错误... – Eric
你确定你的.wav文件是标准的吗?它是不是压缩或不? – Skyler