#include <audiostream.h>
Public Member Functions | |
StatelessPacketizedAudioStream (uint rate, uint channels) | |
bool | isStereo () const |
int | getRate () const |
int | readBuffer (int16 *data, const int numSamples) |
bool | endOfData () const |
bool | endOfStream () const |
void | queuePacket (Common::SeekableReadStream *data) |
void | finish () |
uint | getChannels () const |
Protected Member Functions | |
virtual AudioStream * | makeStream (Common::SeekableReadStream *data)=0 |
A PacketizedAudioStream that works closer to a QueuingAudioStream.
It queues individual packets as a whole AudioStream to an internal QueuingAudioStream. This is used for writing quick wrappers against e.g. RawStream, which can be then made into PacketizedAudioStreams.
|
inline |
Create a StatelessPacketizedAudioStream with the specified sample rate and for the specified number of channels.
|
inlinevirtual |
Check whether this is a stereo stream.
Implements Audio::AudioStream.
|
inlinevirtual |
Sample rate of the stream.
Implements Audio::AudioStream.
|
inlinevirtual |
Fill the given buffer with up to numSamples
samples.
Data must be in native endianness, 16 bits per sample, signed. For stereo stream, the buffer will be filled with interleaved left and right channel samples, starting with the 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.
Implements Audio::AudioStream.
|
inlinevirtual |
Check whether end of data has been reached.
If this returns true, it indicates that at this time there is no data available in the stream. However, there might be more data in the future.
This is used by e.g. a rate converter to decide whether to keep on converting data or to stop.
Implements Audio::AudioStream.
|
inlinevirtual |
Check whether end of stream has been reached.
If this returns true, it indicates that all data in this stream is used up and no additional data will appear in it in the future.
This is used by the mixer to decide whether a given stream shall be removed from the list of active streams (and thus be destroyed). By default, this maps to endOfData().
Reimplemented from Audio::AudioStream.
|
inlinevirtual |
Queue the next packet to be decoded.
Implements Audio::PacketizedAudioStream.
|
inlinevirtual |
Mark this stream as finished. That is, signal that no further data
This is used to signal that no further data will be queued to the stream. The stream is only considered as ended after this has been done.
Implements Audio::PacketizedAudioStream.
|
inline |
Return how many channels this stream is using.
|
protectedpure virtual |
Create an AudioStream for a given packet.
Implemented in Audio::XanDPCMStream.