Skip to content

Commit 9bae85b

Browse files
committed
wave: add documentation for undocumented methods
These methods are public but were previously not documented. This caused the unit tests to fail when I mentioned changes to getparams() in the whats new ;-)
1 parent 7a1fce1 commit 9bae85b

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Doc/library/wave.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,21 @@ Wave_write Objects
194194
Set the number of channels.
195195

196196

197+
.. method:: getnchannels()
198+
199+
Return the number of channels.
200+
201+
197202
.. method:: setsampwidth(n)
198203

199204
Set the sample width to *n* bytes.
200205

201206

207+
.. method:: getsampwidth()
208+
209+
Return the sample width in bytes.
210+
211+
202212
.. method:: setframerate(n)
203213

204214
Set the frame rate to *n*.
@@ -208,19 +218,39 @@ Wave_write Objects
208218
integer.
209219

210220

221+
.. method:: getframerate()
222+
223+
Return the frame rate.
224+
225+
211226
.. method:: setnframes(n)
212227

213228
Set the number of frames to *n*. This will be changed later if the number
214229
of frames actually written is different (this update attempt will
215230
raise an error if the output stream is not seekable).
216231

217232

233+
.. method:: getnframes()
234+
235+
Return the number of audio frames written so far.
236+
237+
218238
.. method:: setcomptype(type, name)
219239

220240
Set the compression type and description. At the moment, only compression type
221241
``NONE`` is supported, meaning no compression.
222242

223243

244+
.. method:: getcomptype()
245+
246+
Return the compression type (``'NONE'``).
247+
248+
249+
.. method:: getcompname()
250+
251+
Return the human-readable compression type name.
252+
253+
224254
.. method:: setformat(format)
225255

226256
Set the frame format code.
@@ -244,6 +274,13 @@ Wave_write Objects
244274
accepted and defaults to ``WAVE_FORMAT_PCM``.
245275

246276

277+
.. method:: getparams()
278+
279+
Return a :func:`~collections.namedtuple`
280+
``(nchannels, sampwidth, framerate, nframes, comptype, compname, format)``
281+
containing the current output parameters.
282+
283+
247284
.. method:: tell()
248285

249286
Return current position in the file, with the same disclaimer for the

0 commit comments

Comments
 (0)