#include <Sound.h>
Description
Allows for interaction with a playing sound.
An ActiveSound represents a sample of audio that is currently undergoing playback. As such, you can use the ActiveSound to modify how the corresponding audio is playing. Because typical playback systems are done on separate threads, the reflection of changes caused by the calling of these functions is not immediately guaranteed.
ActiveSound objects are produced by Sound::PlayAudio
Functions | |
void | SetVolume (float v) |
void | SetPanning (float v) |
void | SetRepeat (bool b) |
void | Seek (float f) |
void | SetChannel (uint32_t i) |
void | Stop () |
void | Pause () |
void | Resume () |
bool | Valid () |
Member Function Documentation
void SetVolume | ( | float | v | ) |
Sets the volume of the ActiveSound.
- Parameters
-
v The new volume to use. The value is clamped to the range 0.f and 1.f.
void SetPanning | ( | float | v | ) |
Sets the panning.
- Parameters
-
v The new panning. The value is clamped to the range 0.f and 1.f.
void SetRepeat | ( | bool | b | ) |
Sets whether the sound should be replayed once it finishes.
- Parameters
-
b If true, the sound will repeat. If false, the sound will not repeat. The default is not to repeat.
void Seek | ( | float | f | ) |
Sets the progress in the sound to play from.
- Parameters
-
f The place in the sound to continue playback from. f is interpreted as a fraction of the progress of the sound, where 0 is the beginning of the sound and 1 is the end of the sound. The value is clamped to this range.
void SetChannel | ( | uint32_t | i | ) |
Alters the channel that the sound plays on.
- Parameters
-
i The new channel to play from.
void Stop | ( | ) |
Halts the sound.
void Pause | ( | ) |
Pauses the sound if it was playing.
void Resume | ( | ) |
Resumes the sound's playback if it was Pause()ed.
bool Valid | ( | ) |
Returns whether this ActiveSound actually refers to something that is playing back.
If the sound has Stop()ed or finished on its own, the corresponding ActiveSound will no longer have an effect on anything. It is not an error to use an ActiveSound if it does not refer to an actual sound.
The documentation for this class was generated from the following file:
- /home/jc/git/Dynacoe/DynacoeSrc/includes/Dynacoe/Modules/Sound.h