ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Audio::AudioStream Class Reference

Generic audio input stream. More...

#include <audiostream.h>

Inheritance diagram for Audio::AudioStream:

List of all members.

Public Member Functions

virtual ~AudioStream ()
virtual int readBuffer (int16 *buffer, const int numSamples)=0
 Fill the given buffer with up to numSamples samples.
virtual bool isStereo () const =0
 Is this a stereo stream?
virtual int getRate () const =0
 Sample rate of the stream.
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.
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.

Detailed Description

Generic audio input stream.

Subclasses of this are used to feed arbitrary sampled audio data into ScummVM's audio mixer.

Definition at line 43 of file audiostream.h.


Constructor & Destructor Documentation

virtual Audio::AudioStream::~AudioStream (  )  [inline, virtual]

Definition at line 45 of file audiostream.h.


Member Function Documentation

virtual bool Audio::AudioStream::endOfStream (  )  const [inline, virtual]

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.

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 in Audio::QueuingAudioStreamImpl, Audio::LimitingAudioStream, Audio::LoopingAudioStream, Audio::SubLoopingAudioStream, Audio::SubSeekableAudioStream, Audio::StatelessPacketizedAudioStream, Audio::AC3Stream, and Audio::PacketizedMP3Stream.

Definition at line 85 of file audiostream.h.

virtual int Audio::AudioStream::readBuffer ( int16 buffer,
const int  numSamples 
) [pure virtual]

Fill the given buffer with up to numSamples samples.

Returns the actual number of samples read, or -1 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 endianess, 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.

Implemented in AudioCDStream, Audio::QueuingAudioStreamImpl, Audio::LimitingAudioStream, Audio::NullAudioStream, Audio::LoopingAudioStream, Audio::SubLoopingAudioStream, Audio::SubSeekableAudioStream, Audio::StatelessPacketizedAudioStream, Audio::Audio3DO_ADP4_Stream, Audio::Audio3DO_SDX2_Stream, Audio::AC3Stream, Audio::Oki_ADPCMStream, Audio::DVI_ADPCMStream, Audio::Apple_ADPCMStream, Audio::MSIma_ADPCMStream, Audio::MS_ADPCMStream, Audio::DK3_ADPCMStream, Audio::ASFStream, Audio::FLACStream, Audio::MP3Stream, Audio::PacketizedMP3Stream, Audio::SilentAudioStream, Audio::ForcedMonoAudioStream, Audio::QuickTimeAudioDecoder::QuickTimeAudioTrack, Audio::RawStream< is16Bit, isUnsigned, isLE >, Audio::VorbisStream, Audio::XAStream, Grim::SCXStream, Grim::EMISubLoopingAudioStream, Stark::Formats::ISSADPCMStream, and Video::SilentAudioStream.


The documentation for this class was generated from the following file:


Generated on Sat Sep 14 2019 05:03:45 for ResidualVM by doxygen 1.7.1
curved edge   curved edge