An audio manager.
Pulse-code modulation (PCM) is a method used to digitally represent
sampled analog signals. A PCM signal is a sequence of digital audio
samples containing the data providing the necessary information to
reconstruct the original analog signal. Each sample represents the
amplitude of the signal at a specific point in time, and the samples
are uniformly spaced in time.
The amplitude is the only information explicitly stored in the sample.
A PCM stream has two basic properties that determine the stream's
fidelity to the original analog signal: the sampling rate, which is the
number of times per second that samples are taken; and the bit depth,
which determines the number of possible digital values that can be used
to represent each sample.
For speech analysis, recommended sampling rate are 16000 (for automatic
analysis) or 48000 (for manual analysis); and recommended sample depths
are 16 per sample.
These variables are user gettable through appropriate methods:
- nchannels -- the number of audio channels
- framerate -- the sampling frequency
- sampwidth -- the number of bytes per audio sample (1, 2 or 4)
- nframes -- the number of frames
- params -- parameters of the wave file
- filename -- the name of the wave file
The audiofp member is assigned by the IO classes (WaveIO only).
It is expected that it can access the following methods:
- readframes()
- writeframes()
- getsampwidth()
- getframerate()
- getnframes()
- getnchannels()
- setpos()
- tell()
- rewind()