]> granicus.if.org Git - python/commitdiff
Fix by Jean-Claude Rimbault [ Bug #116271 ] -- the WAVE header was
authorGuido van Rossum <guido@python.org>
Mon, 9 Oct 2000 20:01:53 +0000 (20:01 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 9 Oct 2000 20:01:53 +0000 (20:01 +0000)
never written properly because the '4' length indicators for the 's'
format characters were missing.

Lib/wave.py

index c8cf997ecaa788a6a5797b5f321f09fd94f0266b..49e070f8939ea673ee4b3b5b29c083a3aa18143f 100644 (file)
@@ -439,7 +439,7 @@ class Wave_write:
             self._nframes = initlength / (self._nchannels * self._sampwidth)
         self._datalength = self._nframes * self._nchannels * self._sampwidth
         self._form_length_pos = self._file.tell()
-        self._file.write(struct.pack('<lsslhhllhhs',
+        self._file.write(struct.pack('<l4s4slhhllhh4s',
             36 + self._datalength, 'WAVE', 'fmt ', 16,
             WAVE_FORMAT_PCM, self._nchannels, self._framerate,
             self._nchannels * self._framerate * self._sampwidth,