summaryrefslogtreecommitdiffstats
path: root/Lib/sunau.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-11-10 19:02:53 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-11-10 19:02:53 (GMT)
commit81895f8ee327474b5a07a12e957b786510227b29 (patch)
tree7b2e5049c97e2f9f2521fce809b071f0a7980bc8 /Lib/sunau.py
parenta49ccb205fa2f25bf3d09d8f99476942ec3d66fd (diff)
downloadcpython-81895f8ee327474b5a07a12e957b786510227b29.zip
cpython-81895f8ee327474b5a07a12e957b786510227b29.tar.gz
cpython-81895f8ee327474b5a07a12e957b786510227b29.tar.bz2
Issue #19261: Added support for writing 24-bit samples in the sunau module.
Diffstat (limited to 'Lib/sunau.py')
-rw-r--r--Lib/sunau.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/sunau.py b/Lib/sunau.py
index 5761390..1880a01 100644
--- a/Lib/sunau.py
+++ b/Lib/sunau.py
@@ -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