Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e08a66a

Browse files
committed
Document the fact that 'compname' and 'comptype' are bytes.
1 parent a3b0d20 commit e08a66a

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

Doc/library/aifc.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,16 @@ following methods:
7474

7575
.. method:: aifc.getcomptype()
7676

77-
Return a four-character string describing the type of compression used in the
78-
audio file. For AIFF files, the returned value is ``'NONE'``.
77+
Return a bytes array of length 4 describing the type of compression
78+
used in the audio file. For AIFF files, the returned value is
79+
``b'NONE'``.
7980

8081

8182
.. method:: aifc.getcompname()
8283

83-
Return a human-readable description of the type of compression used in the audio
84-
file. For AIFF files, the returned value is ``'not compressed'``.
84+
Return a bytes array convertible to a human-readable description
85+
of the type of compression used in the audio file. For AIFF files,
86+
the returned value is ``b'not compressed'``.
8587

8688

8789
.. method:: aifc.getparams()
@@ -180,11 +182,12 @@ number of frames must be filled in.
180182
single: A-LAW
181183
single: G.722
182184

183-
Specify the compression type. If not specified, the audio data will not be
184-
compressed. In AIFF files, compression is not possible. The name parameter
185-
should be a human-readable description of the compression type, the type
186-
parameter should be a four-character string. Currently the following
187-
compression types are supported: NONE, ULAW, ALAW, G722.
185+
Specify the compression type. If not specified, the audio data will
186+
not be compressed. In AIFF files, compression is not possible.
187+
The name parameter should be a human-readable description of the
188+
compression type as a bytes array, the type parameter should be a
189+
bytes array of length 4. Currently the following compression types
190+
are supported: ``b'NONE'``, ``b'ULAW'``, ``b'ALAW'``, ``b'G722'``.
188191

189192

190193
.. method:: aifc.setparams(nchannels, sampwidth, framerate, comptype, compname)

Lib/test/test_aifc.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ def test_params(self):
3535
self.assertEqual(f.getsampwidth(), 2)
3636
self.assertEqual(f.getframerate(), 48000)
3737
self.assertEqual(f.getnframes(), 14400)
38-
# XXX: are the next two correct? The docs say/imply they are supposed
39-
# to be strings.
4038
self.assertEqual(f.getcomptype(), b'NONE')
4139
self.assertEqual(f.getcompname(), b'not compressed')
4240
self.assertEqual(

0 commit comments

Comments
 (0)