[issue1423] wave sunau aifc 16bit errors

jeroen report at bugs.python.org
Mon Nov 12 19:35:27 CET 2007


jeroen added the comment:

I played using winsound.PlaySound function for the wav. I used VLC and windows media player for wav,au and aiff after that

All had the same problem. It was solved for sunau by doubling the nframes number written by the close function in the sunau module. I assume something similar should be done for the wav and aiff modules.

This is what I changed in sunau I am not sure if adding *self._sampwidth breaks something else. It works for me now when I create 16bit stereo files.

def _patchheader(self):
        self._file.seek(8)
        # jjk added * sampwidth otherwise for 16 bit you get wrong nframes
        _write_u32(self._file, self._datawritten*self._sampwidth)
        self._datalength = self._datawritten
        self._file.seek(0, 2)

Hope this helps.
greetings

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1423>
__________________________________


More information about the Python-bugs-list mailing list