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

Audio::ForcedMonoAudioStream Class Reference

An AudioStream wrapper that forces audio to be played in mono. More...

Inheritance diagram for Audio::ForcedMonoAudioStream:
Collaboration diagram for Audio::ForcedMonoAudioStream:

List of all members.

Public Member Functions

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

Private Attributes

AudioStream_parentStream
DisposeAfterUse::Flag _disposeAfterUse

Detailed Description

An AudioStream wrapper that forces audio to be played in mono.

It currently just ignores the right channel if stereo.

Definition at line 68 of file audio/decoders/quicktime.cpp.


Constructor & Destructor Documentation

Audio::ForcedMonoAudioStream::ForcedMonoAudioStream ( AudioStream parentStream,
DisposeAfterUse::Flag  disposeAfterUse = DisposeAfterUse::YES 
) [inline]

Definition at line 70 of file audio/decoders/quicktime.cpp.

Audio::ForcedMonoAudioStream::~ForcedMonoAudioStream (  )  [inline]

Definition at line 73 of file audio/decoders/quicktime.cpp.


Member Function Documentation

bool Audio::ForcedMonoAudioStream::endOfData (  )  const [inline, virtual]

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 Audio::AudioStream.

Definition at line 94 of file audio/decoders/quicktime.cpp.

int Audio::ForcedMonoAudioStream::getRate (  )  const [inline, virtual]

Sample rate of the stream.

Implements Audio::AudioStream.

Definition at line 96 of file audio/decoders/quicktime.cpp.

bool Audio::ForcedMonoAudioStream::isStereo (  )  const [inline, virtual]

Is this a stereo stream?

Implements Audio::AudioStream.

Definition at line 95 of file audio/decoders/quicktime.cpp.

int Audio::ForcedMonoAudioStream::readBuffer ( int16 buffer,
const int  numSamples 
) [inline, 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.

Implements Audio::AudioStream.

Definition at line 78 of file audio/decoders/quicktime.cpp.


Member Data Documentation


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


Generated on Sat May 18 2019 05:05:43 for ResidualVM by doxygen 1.7.1
curved edge   curved edge