PyDocs

Nav

Multimedia Services

Wave_read

wave

class (source)
  • Wave_read(f)
Variables used in this class:

These variables are available to the user though appropriate
methods of this class:
_file -- the open file with methods read(), close(), and seek()
          set through the __init__() method
_nchannels -- the number of audio channels
          available through the getnchannels() method
_nframes -- the number of audio frames
          available through the getnframes() method
_sampwidth -- the number of bytes per audio sample
          available through the getsampwidth() method
_framerate -- the sampling frequency
          available through the getframerate() method
_format -- frame format
          One of WAVE_FORMAT_PCM, WAVE_FORMAT_IEEE_FLOAT
          or WAVE_FORMAT_EXTENSIBLE available through
          getformat() method
_comptype -- the AIFF-C compression type ('NONE' if AIFF)
          available through the getcomptype() method
_compname -- the human-readable AIFF-C compression type
          available through the getcomptype() method
_soundpos -- the position in the audio stream
          available through the tell() method, set through the
          setpos() method

These variables are used internally only:
_fmt_chunk_read -- 1 iff the FMT chunk has been read
_data_seek_needed -- 1 iff positioned correctly in audio
          file for readframes()
_data_chunk -- instantiation of a chunk class for the DATA chunk
_framesize -- size of one frame in the file
Members of Wave_read

c

close
Close the stream if it was opened by wave, and make the instance unusable.

g

getcompname
Human-readable version of getcomptype().
getcomptype
Returns compression type ('NONE' is the only supported type).
getformat
Returns the frame format code.
getframerate
Returns sampling frequency.
getnchannels
Returns number of audio channels (1 for mono, 2 for stereo).
getnframes
Returns number of audio frames.
getparams
Returns a namedtuple() (nchannels, sampwidth, framerate, nframes, comptype, compname), equivalent to output of the get*() methods.
getsampwidth
Returns sample width in bytes.

r

readframes
Reads and returns at most n frames of audio, as a bytes object.
rewind
Rewind the file pointer to the beginning of the audio stream.

s

setpos
Set the file pointer to the specified position.

t

tell
Return current file pointer position.
0 Examples
No examples for wave/Wave_read.
See Also
No see-alsos for wave/Wave_read
0 Notes
No notes for Wave_read