engineAddSound
Client
Registers an audio file under a name, which playSound and playSound3D then play by that name.
bool engineAddSound(string name, string path [, int priority = 0])
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | The sound's name, up to 255 characters. Case does not matter. |
| path | string | Path of the audio file in the resource. |
| priority | int | Priority among those who register the same name. The highest wins; among equals, the newest.default 0 |
Returns
true if the sound was registered. Raises an error if the name is too long or the file cannot be read.
The sounds a resource registered are removed when it stops.
Example
engineAddSound("horn_custom", "sounds/horn.ogg")
playSound("horn_custom")