Public Member Functions | |
SampleInstance (int handle, int extra) | |
Called by Sample, do not use. | |
bool | playing () const |
bool | paused () const |
void | pause () |
Pauses this instance to be resumed afterwards. It will still keep a channel filled while paused. | |
void | resume () |
void | stop () |
Stops this instance of a sound being played. | |
void | changeVolume (double volume) |
void | changePan (double pan) |
void | changeSpeed (double speed) |
Can be used to stop sounds dynamically, or to check if they are finished. It is recommended that you throw away sample instances if possible, as they could accidentally refer to other sounds being played after a very long time has passed.
Definition at line 30 of file Audio.hpp.
Gosu::SampleInstance::SampleInstance | ( | int | handle, | |
int | extra | |||
) |
Called by Sample, do not use.
void Gosu::SampleInstance::changePan | ( | double | pan | ) |
pan | Can be anything from -1.0 (left) to 1.0 (right). |
void Gosu::SampleInstance::changeSpeed | ( | double | speed | ) |
speed | Playback speed is only limited by FMOD's capabilities and can accept very high or low values. Use 1.0 for normal playback speed. |
void Gosu::SampleInstance::changeVolume | ( | double | volume | ) |
volume | Can be anything from 0.0 (silence) to 1.0 (full volume). |
void Gosu::SampleInstance::pause | ( | ) |
Pauses this instance to be resumed afterwards. It will still keep a channel filled while paused.
bool Gosu::SampleInstance::paused | ( | ) | const |
bool Gosu::SampleInstance::playing | ( | ) | const |
void Gosu::SampleInstance::resume | ( | ) |
void Gosu::SampleInstance::stop | ( | ) |
Stops this instance of a sound being played.
Calling this twice, or too late, does not do any harm.