playSoundAtPosition
Script::playSoundAtPosition
Plays a sound at a certain position and returns a unique identifier to this sound source.
Declaration
SoundSourceID playSoundAtPosition(SoundID soundID, const Math::vec3& position, float gain, float pitch);
Parameters
Name |
Type |
Description |
---|---|---|
soundID |
The sound to play or resume. |
|
position |
Math::vec3 |
The position to play the sound at. |
gain |
float |
The initial sound source gain. |
pitch |
float |
The initial sound source pitch. |
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 no listener Entity has been set, the sound will be played globally.