ScummVM API documentation
Sword2::Sound Class Reference
Inheritance diagram for Sword2::Sound:
Audio::AudioStream

Public Member Functions

 Sound (Sword2Engine *vm)
 
int readBuffer (int16 *buffer, const int numSamples) override
 
bool isStereo () const override
 
bool endOfData () const override
 
int getRate () const override
 
void clearFxQueue (bool killMovieSounds)
 
void processFxQueue ()
 
void setReverseStereo (bool reverse)
 
bool isReverseStereo () const
 
void muteSpeech (bool mute)
 
bool isSpeechMute () const
 
void muteFx (bool mute)
 
bool isFxMute () const
 
void muteMusic (bool mute)
 
bool isMusicMute () const
 
void setLoopingMusicId (int32 id)
 
int32 getLoopingMusicId () const
 
void pauseSpeech ()
 
void unpauseSpeech ()
 
void pauseFx ()
 
void unpauseFx ()
 
void pauseMusic ()
 
void unpauseMusic ()
 
void playMovieSound (int32 res, int type)
 
void stopMovieSounds ()
 
void queueFx (int32 res, int32 type, int32 delay, int32 volume, int32 pan)
 
int32 playFx (FxQueueEntry *fx)
 
int32 playFx (Audio::SoundHandle *handle, byte *data, uint32 len, uint8 vol, int8 pan, bool loop, Audio::Mixer::SoundType soundType)
 
int32 stopFx (int32 i)
 
int32 setFxIdVolumePan (int32 id, int vol, int pan=255)
 
int32 getSpeechStatus ()
 
int32 amISpeaking ()
 
int32 playCompSpeech (uint32 speechId, uint8 vol, int8 pan)
 
int32 stopSpeech ()
 
int32 streamCompMusic (uint32 musicId, bool loop)
 
void stopMusic (bool immediately)
 
int32 musicTimeRemaining ()
 
void printFxQueue ()
 
- Public Member Functions inherited from Audio::AudioStream
virtual bool endOfStream () const
 

Member Function Documentation

◆ readBuffer()

int Sword2::Sound::readBuffer ( int16 *  buffer,
const int  numSamples 
)
overridevirtual

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.

Returns
The actual number of samples read, or -1 if a critical error occurred.
Note
You must check whether the returned value is less than what you requested. This indicates that the stream is fully used up.

Implements Audio::AudioStream.

◆ isStereo()

bool Sword2::Sound::isStereo ( ) const
inlineoverridevirtual

Check whether this is a stereo stream.

Implements Audio::AudioStream.

◆ endOfData()

bool Sword2::Sound::endOfData ( ) const
overridevirtual

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.

◆ getRate()

int Sword2::Sound::getRate ( ) const
inlineoverridevirtual

Sample rate of the stream.

Implements Audio::AudioStream.


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