mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #19261: Added support for writing 24-bit samples in the sunau module.
This commit is contained in:
parent
a49ccb205f
commit
81895f8ee3
5 changed files with 37 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue