playSound
AudioModuleInterface::playSound
Plays a global sound and returns a unique identifier to this sound source.
Declaration
virtual SoundSourceID playSound(SoundID soundID, float gain, float pitch, bool looping, float startTime) = 0;
Parameters
Name |
Type |
Description |
|---|---|---|
soundID |
The sound to play or resume. |
|
gain |
float |
The initial sound source gain. |
pitch |
float |
The initial sound source pitch. |
looping |
bool |
Whether the sound is looping or not. |
startTime |
float |
The start time of the sound. |
Returns
A unique SoundSourceID.
Notes
Each time this function is called, a new sound source will be played and a new SoundSourceID will be returned.
If startTime is superior to the length of the sound, if looping is false, the sound will stop directly, else, if looping is true, the sound will start at startTime modulo the length of the sound.