Source

cpython_sandbox / Doc / library / wave.rst

Full commit

:mod:`wave` --- Read and write WAV files

Source code: :source:`Lib/wave.py`


The :mod:`wave` module provides a convenient interface to the WAV sound format. It does not support compression/decompression, but it does support mono/stereo.

The :mod:`wave` module defines the following function and exception:

Wave_read Objects

Wave_read objects, as returned by :func:`.open`, have the following methods:

The following two methods are defined for compatibility with the :mod:`aifc` module, and don't do anything interesting.

The following two methods define a term "position" which is compatible between them, and is otherwise implementation dependent.

Wave_write Objects

Wave_write objects, as returned by :func:`.open`, have the following methods:

Note that it is invalid to set any parameters after calling :meth:`writeframes` or :meth:`writeframesraw`, and any attempt to do so will raise :exc:`wave.Error`.