I try to open a wave file with the wave module, but I keep getting the same error whatever I try. The line with the error is the following:
wav = wave.open(f) This is the error message:
Traceback (most recent call last): File "annotate.py", line 47, in <module> play(file) File "annotate.py", line 33, in play wav = wave.open(f) File "C:\Program Files (x86)\Python\lib\wave.py", line 498, in open return Wave_read(f) File "C:\Program Files (x86)\Python\lib\wave.py", line 163, in __init__ self.initfp(f) File "C:\Program Files (x86)\Python\lib\wave.py", line 143, in initfp self._read_fmt_chunk(chunk) File "C:\Program Files (x86)\Python\lib\wave.py", line 269, in _read_fmt_chunk raise Error('unknown format: %r' % (wFormatTag,)) wave.Error: unknown format: 49 String f is a path to a .WAV file and it works when played in any of my media players. I have of course imported the wave module. I tried f both as a relative and an absolute path. I tried replacing "WAV" by "wav".
What is the error caused by?