#include <audio.h>
Inheritance diagram for AudioCodec:

Public Methods | |
| virtual void | Encode (unsigned short *buffer, unsigned samples=0, int channel=0)=0 |
| Encode a linear sample frame into the codec sample buffer. More... | |
| virtual unsigned | Decode (unsigned short *buffer, int channel=0)=0 |
| Decode the sample frame into linear samples. More... | |
| virtual unsigned | Load (unsigned char *data, unsigned length) |
| Load a codec from a byte stream data source. More... | |
| virtual unsigned | Save (unsigned char *data, unsigned length) |
| Save a codec to a byte stream data source. More... | |
| unsigned | getLength (void) |
| Get current number of samples of data, based on load or encode. More... | |
| unsigned | getFrameSize (void) |
| Get size of the audio frame. | |
| virtual unsigned | getChannels (void) |
| Check if stereo/multi-channel codec. | |
Protected Methods | |
| AudioCodec (unsigned frames, audioencoding_t encoding, unsigned rate) | |
Protected Attributes | |
| unsigned | length |
This class is only abstract and describes the core interface for loadable codec modules. This class is normally merged with AudioSample. A derived AudioCodecXXX will typically include a AudioRegisterXXX static class to automatically initialize and register the codec with the codec registry.
|
|
|
|
|
Decode the sample frame into linear samples.
|
|
|
Encode a linear sample frame into the codec sample buffer.
|
|
|
Load a codec from a byte stream data source. This is used for streaming of compressed codec's where frames are of irregular sizes.
|
|
|
Save a codec to a byte stream data source. This is used for streaming of compressed codec's where frames are of irregular sizes.
|
|
|
Check if stereo/multi-channel codec.
|
|
|
Get size of the audio frame.
|
|
|
Get current number of samples of data, based on load or encode.
|
|
|
|
1.2.5 written by Dimitri van Heesch,
© 1997-2001