14.4.1 AU_read Objects
AU_read objects, as returned by open() above, have the
following methods:
-
Close the stream, and make the instance unusable. (This is
called automatically on deletion.)
-
Returns number of audio channels (1 for mone, 2 for stereo).
-
Returns sample width in bytes.
-
Returns sampling frequency.
-
Returns number of audio frames.
-
Returns compression type.
Supported compression types are
'ULAW'
, 'ALAW'
and 'NONE'
.
-
Human-readable version of getcomptype().
The supported types have the respective names
'CCITT G.711
u-law'
, 'CCITT G.711 A-law'
and 'not compressed'
.
-
Returns a tuple
(nchannels, sampwidth,
framerate, nframes, comptype, compname)
,
equivalent to output of the get*() methods.
-
Reads and returns at most n frames of audio, as a string of
bytes. The data will be returned in linear format. If the original
data is in u-LAW format, it will be converted.
-
Rewind the file pointer to the beginning of the audio stream.
The following two methods define a term ``position'' which is compatible
between them, and is otherwise implementation dependent.
-
Set the file pointer to the specified position. Only values returned
from tell() should be used for pos.
-
Return current file pointer position. Note that the returned value
has nothing to do with the actual position in the file.
The following two functions are defined for compatibility with the
aifc, and don't do anything interesting.
-
Returns
None
.
-
Raise an error.
Release 2.4.4, documentation updated on 18 October 2006.
See About this document... for information on suggesting changes.