Issue #19261: Added support for writing 24-bit samples in the sunau module.

This commit is contained in:
Serhiy Storchaka 2013-11-10 21:02:53 +02:00
parent a49ccb205f
commit 81895f8ee3
5 changed files with 37 additions and 1 deletions

View file

@ -352,7 +352,7 @@ class Au_write:
def setsampwidth(self, sampwidth):
if self._nframeswritten:
raise Error('cannot change parameters after starting to write')
if sampwidth not in (1, 2, 4):
if sampwidth not in (1, 2, 3, 4):
raise Error('bad sample width')
self._sampwidth = sampwidth
@ -465,6 +465,9 @@ class Au_write:
elif self._sampwidth == 2:
encoding = AUDIO_FILE_ENCODING_LINEAR_16
self._framesize = 2
elif self._sampwidth == 3:
encoding = AUDIO_FILE_ENCODING_LINEAR_24
self._framesize = 3
elif self._sampwidth == 4:
encoding = AUDIO_FILE_ENCODING_LINEAR_32
self._framesize = 4