Author alex_python_org
Recipients alex_python_org
Date 2009-01-11.02:16:41
SpamBayes Score 0.00343188
Marked as misclassified No
Message-id <1231640203.22.0.836631115229.issue4913@psf.upfronthosting.co.za>
In-reply-to
Content
Corrected code in writeframesraw():

            self._datawritten = self._datawritten + len(data) *
self._sampwidth
        else:
            self._file.write(data)
            self._datawritten = self._datawritten + len(data) *
self._sampwidth


Note that the default (not byte swapped) assignment to _datawritten must
also be multiplied by _sampwidth. If not, audio programs will ignore the
second half of a 16-bit-sample file.

As a side note, the calls to _patchheader() do not need to be protected
by this "if" statement:

        if self._datalength != self._datawritten:

_patchheader does the same test to optimize its operation.
History
Date User Action Args
2009-01-11 02:16:43alex_python_orgsetrecipients: + alex_python_org
2009-01-11 02:16:43alex_python_orgsetmessageid: <1231640203.22.0.836631115229.issue4913@psf.upfronthosting.co.za>
2009-01-11 02:16:42alex_python_orglinkissue4913 messages
2009-01-11 02:16:41alex_python_orgcreate