Represents an Ogg Vorbis stream. More...
#include "OggVorbisStream.hpp"
Public Member Functions | |
OggVorbisStreamT (const std::string &FileName) | |
The constructor. More... | |
~OggVorbisStreamT () | |
Destructor. More... | |
int | Read (unsigned char *Buffer, unsigned int Size) |
Reads an amount of bytes from the stream and writes them into the buffer. More... | |
bool | Rewind () |
Sets the stream back to the beginning. More... | |
unsigned int | GetChannels () |
Returns the number of channels in the current stream. More... | |
unsigned int | GetRate () |
Get the sampling rate of this stream. More... | |
![]() | |
virtual | ~SoundStreamT () |
Virtual destructor to make sure the destructor of the derived class is called. More... | |
Additional Inherited Members | |
![]() | |
static SoundStreamT * | Create (const std::string &ResName) |
Creates a new sound stream for the specified resource. More... | |
Represents an Ogg Vorbis stream.
Audio data is decompressed and readable as 16 bit enconded mono or stereo raw PCM data. This class uses libogg and libvorbis provided by Xiph.org to read PCM data from an Ogg Vorbis file.
OggVorbisStreamT::OggVorbisStreamT | ( | const std::string & | FileName | ) |
The constructor.
Throws an exception of type std::runtime_error on failure. Creates an audio data stream from an Ogg Vorbis file.
FileName | The path to the file from which the stream should be created. |
OggVorbisStreamT::~OggVorbisStreamT | ( | ) |
Destructor.
|
virtual |
Returns the number of channels in the current stream.
Implements SoundStreamT.
|
virtual |
|
virtual |
Reads an amount of bytes from the stream and writes them into the buffer.
Buffer | Buffer to write the data into. |
Size | Amount of bytes to be read from the stream and write in the buffer. |
Implements SoundStreamT.
|
virtual |
Sets the stream back to the beginning.
Implements SoundStreamT.