From 81895f8ee327474b5a07a12e957b786510227b29 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 10 Nov 2013 21:02:53 +0200 Subject: [PATCH] Issue #19261: Added support for writing 24-bit samples in the sunau module. --- Doc/library/sunau.rst | 3 +++ Lib/sunau.py | 5 ++++- Lib/test/audiodata/pluck-pcm24.au | Bin 0 -> 19866 bytes Lib/test/test_sunau.py | 28 ++++++++++++++++++++++++++++ Misc/NEWS | 2 ++ 5 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 Lib/test/audiodata/pluck-pcm24.au diff --git a/Doc/library/sunau.rst b/Doc/library/sunau.rst index eae710d03bf..6455ed9c75a 100644 --- a/Doc/library/sunau.rst +++ b/Doc/library/sunau.rst @@ -212,6 +212,9 @@ AU_write objects, as returned by :func:`.open` above, have the following methods Set the sample width (in bytes.) + .. versionchanged:: 3.4 + Added support for 24-bit samples. + .. method:: AU_write.setframerate(n) diff --git a/Lib/sunau.py b/Lib/sunau.py index 5761390361c..1880a01d1a2 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 diff --git a/Lib/test/audiodata/pluck-pcm24.au b/Lib/test/audiodata/pluck-pcm24.au new file mode 100644 index 0000000000000000000000000000000000000000..0bb230418a3844b81637c7b4b1ea3f18f3bfe2d6 GIT binary patch literal 19866 zcmWiebySpJ6UU$0eKy%;S-Lw^6e$A%K`cPTM8QS{6;xEzA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p>5Z`U{uu!fA@!T`2x?!5zKDz5Dp-2RZZzEIKF83bH;3xjT?wdZ17Hz+fES zdbvKmespvDM!%mZytY&jiDW66dgaAUG^bR-nH;b0TUaTV!Z zVB@g% Q5k_cPsXyxS68(SuFDCQN5C8xG literal 0 HcmV?d00001 diff --git a/Lib/test/test_sunau.py b/Lib/test/test_sunau.py index 767314f5b27..81acd964c22 100644 --- a/Lib/test/test_sunau.py +++ b/Lib/test/test_sunau.py @@ -47,6 +47,34 @@ class SunauPCM16Test(audiotests.AudioWriteTests, """) +class SunauPCM24Test(audiotests.AudioWriteTests, + audiotests.AudioTestsWithSourceFile, + unittest.TestCase): + module = sunau + sndfilename = 'pluck-pcm24.au' + sndfilenframes = 3307 + nchannels = 2 + sampwidth = 3 + framerate = 11025 + nframes = 48 + comptype = 'NONE' + compname = 'not compressed' + frames = bytes.fromhex("""\ + 022D65FFEB9D 4B5A0F00FA54 3113C304EE2B 80DCD6084303 \ + CBDEC006B261 48A99803F2F8 BFE82401B07D 036BFBFE7B5D \ + B85756FA3EC9 B4B055F3502B 299830EBCB62 1A5CA7E6D99A \ + EDFA3EE491BD C625EBE27884 0E05A9E0B6CF EF2929E02922 \ + 5758D8E27067 FB3557E83E16 1377BFEF8402 D82C5BF7272A \ + 978F16FB7745 F5F865FC1013 086635FB9C4E DF30FCFB40EE \ + 117FE0FA3438 3EE6B8FB5AC3 BC77A3FCB2F4 66D6DAFF5F32 \ + CF13B9041275 431D69097A8C C1BB600EC74E 5120B912A2BA \ + EEDF641754C0 8207001664B7 7FFFFF14453F 8000001294E6 \ + 499C1B0EB3B2 52B73E0DBCA0 EFB2B20F5FD8 CE3CDB0FBE12 \ + E4B49C0CEA2D 6344A80A5A7C 08C8FE0A1FFE 2BB9860B0A0E \ + 51486F0E44E1 8BCC64113B05 B6F4EC0EEB36 4413170A5B48 \ + """) + + class SunauPCM32Test(audiotests.AudioWriteTests, audiotests.AudioTestsWithSourceFile, unittest.TestCase): diff --git a/Misc/NEWS b/Misc/NEWS index b4cb1e0c02e..421e097e092 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -34,6 +34,8 @@ Core and Builtins Library ------- +- Issue #19261: Added support for writing 24-bit samples in the sunau module. + - Issue #1097797: Added CP273 encoding, used on IBM mainframes in Germany and Austria. Mapping provided by Michael Bierenfeld.