xoreos
0.0.5
|
An empty audio stream that plays nothing. More...
#include <audiostream.h>
Public Member Functions | |
EmptyAudioStream () | |
size_t | readBuffer (int16 *buffer, const size_t numSamples) |
Fill the given buffer with up to numSamples samples. More... | |
int | getChannels () const |
Return the number channels in this stream. More... | |
int | getRate () const |
Sample rate of the stream. More... | |
bool | endOfData () const |
End of data reached? If this returns true, it means that at this time there is no data available in the stream. More... | |
bool | rewind () |
Rewinds the stream to its start. More... | |
uint64 | getLength () const |
Estimate the total number of samples per channel in this stream. More... | |
Public Member Functions inherited from Sound::RewindableAudioStream | |
virtual uint64 | getDuration () const |
Estimate the total duration of the stream in milliseconds. More... | |
Public Member Functions inherited from Sound::AudioStream | |
virtual | ~AudioStream () |
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... | |
Additional Inherited Members | |
Static Public Attributes inherited from Sound::RewindableAudioStream | |
static const uint64 | kInvalidLength = UINT64_C(0xFFFFFFFFFFFFFFFF) |
Static Public Attributes inherited from Sound::AudioStream | |
static const size_t | kSizeInvalid = SIZE_MAX |
An empty audio stream that plays nothing.
Definition at line 155 of file audiostream.h.
|
inline |
Definition at line 157 of file audiostream.h.
|
inlinevirtual |
End of data reached? If this returns true, it means that at this time there is no data available in the stream.
However there may be more data in the future. This is used by e.g. a rate converter to decide whether to keep on converting data or stop.
Implements Sound::AudioStream.
Definition at line 165 of file audiostream.h.
|
inlinevirtual |
Return the number channels in this stream.
Implements Sound::AudioStream.
Definition at line 161 of file audiostream.h.
|
inlinevirtual |
Estimate the total number of samples per channel in this stream.
If this value is not calculatable, return kInvalidLength.
Reimplemented from Sound::RewindableAudioStream.
Definition at line 168 of file audiostream.h.
|
inlinevirtual |
Sample rate of the stream.
Implements Sound::AudioStream.
Definition at line 163 of file audiostream.h.
|
inlinevirtual |
Fill the given buffer with up to numSamples samples.
Returns the actual number of samples read, or kSizeInvalid if a critical error occurred (note: you must check if this value is less than what you requested, this can happen when the stream is fully used up).
Data has to be in native endianness, 16 bit per sample, signed. For stereo stream, buffer will be filled with interleaved left and right channel samples, starting with a left sample. Furthermore, the samples in the left and right are summed up. So if you request 4 samples from a stereo stream, you will get a total of two left channel and two right channel samples.
The same holds true for more channels. Channel configurations recognized:
Implements Sound::AudioStream.
Definition at line 159 of file audiostream.h.
|
inlinevirtual |
Rewinds the stream to its start.
Implements Sound::RewindableAudioStream.
Definition at line 166 of file audiostream.h.