scipy.io.wavfile donne “WavFileWarning: morceau pas compris” erreur

Je suis en train de lire un .fichier wav à l'aide de scipy. Je fais ceci:

from scipy.io import wavfile

filename = "myWavFile.wav"
print "Processing " + filename

samples = wavfile.read(filename)

Et je reçois ce vilain message d'erreur:

/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

Je suis à l'aide de Python 2.6.6, numpy 1.6.2, et scipy 0.11.0

Voici un fichier wav qui provoque le problème.

Toute pensée? Quel est le problème ici?

  • essayez samples = wavfile.read(open(filename, 'r'))
  • Il a essayé, toujours la même erreur...
  • êtes-vous sûr que votre .fichier wav est standard? est-il non compressé ou pas?
  • Avez-vous essayé Python wave module (docs.python.org/2/library/wave.html)?
InformationsquelleAutor Eric | 2013-01-14