AudioFormat_OGG Class Reference
[Audio]

Public Member Functions | |
| AudioFormat_OGG (const Asset &asset) | |
| virtual | ~AudioFormat_OGG () |
| virtual int | GetChannels () |
| virtual int | GetFrequency () |
| virtual int | GetBitsPerSample () |
| virtual int | GetSize () |
| virtual int | GetPosition () |
| virtual void | SetPosition (int position) |
| virtual int | CopySoundChunk (void *buffer, int bytes) |
Static Public Member Functions | |
| static void | Register () |
| static bool | TestAsset (const Asset &asset) |
| static AudioFormat * | Create (const Asset &asset) |
Detailed Description
Definition at line 21 of file AudioFormat_OGG.h.
Constructor & Destructor Documentation
| AudioFormat_OGG::AudioFormat_OGG | ( | const Asset & | asset | ) |
Constructor
Definition at line 55 of file AudioFormat_OGG.cpp.
| AudioFormat_OGG::~AudioFormat_OGG | ( | ) | [virtual] |
Destructor
Definition at line 111 of file AudioFormat_OGG.cpp.
Member Function Documentation
| void AudioFormat_OGG::Register | ( | ) | [static] |
Definition at line 21 of file AudioFormat_OGG.cpp.
| bool AudioFormat_OGG::TestAsset | ( | const Asset & | asset | ) | [static] |
Definition at line 37 of file AudioFormat_OGG.cpp.
| AudioFormat * AudioFormat_OGG::Create | ( | const Asset & | asset | ) | [static] |
Definition at line 29 of file AudioFormat_OGG.cpp.
| int AudioFormat_OGG::GetChannels | ( | ) | [virtual] |
Returns the number of channels this audio data is using 1=mono, 2=stereo
Implements AudioFormat.
Definition at line 121 of file AudioFormat_OGG.cpp.
| int AudioFormat_OGG::GetFrequency | ( | ) | [virtual] |
Returns the frequency of the audio data in number of samples per second
Implements AudioFormat.
Definition at line 130 of file AudioFormat_OGG.cpp.
| int AudioFormat_OGG::GetBitsPerSample | ( | ) | [virtual] |
Returns the number of bits per sample, normally 8 or 16
Implements AudioFormat.
Definition at line 139 of file AudioFormat_OGG.cpp.
| int AudioFormat_OGG::GetSize | ( | ) | [virtual] |
Returns the total size (in bytes) of the raw audio data. To calculate the length of the data in seconds, use this: float length=((float)GetSize())/(float)(GetChannels()*GetFrequency()*GetBitsPerSample())
Implements AudioFormat.
Definition at line 148 of file AudioFormat_OGG.cpp.
| int AudioFormat_OGG::GetPosition | ( | ) | [virtual] |
Returns the current position (in bytes) in the raw audio data stream, meaning the position from which the next call to CopySoundChunk will start outputting data. To convert this position to second, use the same formula as described for GetSize
Implements AudioFormat.
Definition at line 164 of file AudioFormat_OGG.cpp.
| void AudioFormat_OGG::SetPosition | ( | int | position | ) | [virtual] |
Sets the current position (in bytes) in the raw audio data stream, meaning the position from which the next call to CopySoundChunk will start outputting data.
- Parameters:
-
position Position in bytes from the start
Implements AudioFormat.
Definition at line 172 of file AudioFormat_OGG.cpp.
| int AudioFormat_OGG::CopySoundChunk | ( | void * | buffer, | |
| int | bytes | |||
| ) | [virtual] |
Copy a chunk of the raw audio data to the specified memory buffer. The requested number of bytes will be written to the buffer, unless the end of the audio data is reached. The total number of bytes written is always returned.
- Parameters:
-
buffer Buffer to write data to. Must be large enough to hold the requested number of bytes bytes Number of bytes to write. The actual number of bytes written may be less than this if the end of the data is reached.
Implements AudioFormat.
Definition at line 180 of file AudioFormat_OGG.cpp.
Reproduction/republishing of any material on this site without permission is strictly prohibited.
