xoreos
0.0.5
|
A rewindable audio stream. More...
#include <audiostream.h>
Public Member Functions | |
virtual bool | rewind ()=0 |
Rewinds the stream to its start. More... | |
virtual uint64 | getLength () const |
Estimate the total number of samples per channel in this stream. More... | |
virtual uint64 | getDuration () const |
Estimate the total duration of the stream in milliseconds. More... | |
Public Member Functions inherited from Sound::AudioStream | |
virtual | ~AudioStream () |
virtual size_t | readBuffer (int16 *buffer, const size_t numSamples)=0 |
Fill the given buffer with up to numSamples samples. More... | |
virtual int | getChannels () const =0 |
Return the number channels in this stream. More... | |
virtual int | getRate () const =0 |
Sample rate of the stream. More... | |
virtual bool | endOfData () const =0 |
End of data reached? If this returns true, it means that at this time there is no data available in the stream. More... | |
virtual bool | endOfStream () const |
End of stream reached? If this returns true, it means that all data in this stream is used up and no additional data will appear in it in the future. More... | |
Static Public Attributes | |
static const uint64 | kInvalidLength = UINT64_C(0xFFFFFFFFFFFFFFFF) |
Static Public Attributes inherited from Sound::AudioStream | |
static const size_t | kSizeInvalid = SIZE_MAX |
A rewindable audio stream.
This allows for resetting the AudioStream to its initial state. Note that rewinding itself is not required to be working when the stream is being played by Mixer!
Definition at line 125 of file audiostream.h.
|
inlinevirtual |
Estimate the total duration of the stream in milliseconds.
If this value is not calculable, return kInvalidLength.
Reimplemented in Sound::ASFStream.
Definition at line 146 of file audiostream.h.
References getLength(), Sound::AudioStream::getRate(), and kInvalidLength.
|
inlinevirtual |
Estimate the total number of samples per channel in this stream.
If this value is not calculatable, return kInvalidLength.
Reimplemented in Sound::WwRIFFVorbisStream, Sound::EmptyAudioStream, Sound::VorbisStream, Sound::ASFStream, Sound::MP3Stream, Sound::PCMStream< is16Bit, isUnsigned, isLE >, and Sound::ADPCMStream.
Definition at line 140 of file audiostream.h.
References kInvalidLength.
Referenced by getDuration().
|
pure virtual |
Rewinds the stream to its start.
Implemented in Sound::WwRIFFVorbisStream, Sound::EmptyAudioStream, Sound::VorbisStream, Sound::ASFStream, Sound::MP3Stream, Sound::PCMStream< is16Bit, isUnsigned, isLE >, and Sound::ADPCMStream.
Definition at line 127 of file audiostream.h.
Referenced by getDuration(), Sound::LoopingAudioStream::getDuration(), getLength(), and Sound::LoopingAudioStream::getLength().