[Python-bugs-list] [Bug #116271] corrupted wave file header
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 6 Oct 2000 13:05:25 -0700
Bug #116271, was updated on 2000-Oct-06 13:05
Here is a current snapshot of the bug.
Project: Python
Category: Library
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: corrupted wave file header
Details: In module wave.py at line 442 (python2.0b2)
in method _write_header of Wave_write class
the format argument of struct.pack is incorrect:
it should be '<l4s4slhhllhh4s'
(sizes for strings were missing)
by the way, there is no test_wave.py.
here is a simple one:
import os, tempfile
import wave
nchannels = 2
sampwidth = 2
framerate = 8000
nframes = 100
testfile = tempfile.mktemp()
f = wave.open(testfile, 'w')
f.setnchannels(nchannels)
f.setsampwidth(sampwidth)
f.setframerate(framerate)
f.setnframes(nframes)
output = '\0' * nframes * nchannels * sampwidth
f.writeframes(output)
f.close()
f = wave.open(testfile, 'r')
assert nchannels == f.getnchannels()
assert sampwidth == f.getsampwidth()
assert framerate == f.getframerate()
assert nframes == f.getnframes()
input = f.readframes(nframes)
assert input == output
f.close()
os.remove(testfile)
For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=116271&group_id=5470