Repository navigation
Lua Script API: Sound & Music Functions
Plays a sound inside the game. If the sound is finished the tag parameter will be called at onSoundFinished() function.
-
sound- Theoggsound file to be played; Must be relative tomods/soundsorassets/soundsfolders. -
volume- An optional parameter, The specified volume percent of the sound; Goes from0to1; Defualt value:1. -
tag- An optional parameter, The sound object tag name to be used. This will be required if you want to control the sound.
Plays a music inside the game.
-
sound- Theoggmusic file to be played; Must be relative tomods/musicorassets/musicfolders. -
volume- An optional parameter, The specified volume percent of the music; Goes from0to1; Defualt value:1. -
loop- An optional parameter, Whether the music will loop indefinitely; Default value:false.
Stops the sound from playing and removes it permanently.
-
tag- The sound object tag name to be used.
Pauses the sound from playing.
-
tag- The sound object tag name to be used.
Resumes the sound from pausing.
-
tag- The sound object tag name to be used.
Makes the sound fade-in at the start when of the sound. If you want the music to fade then leave tag parameter blank and not a nil value. This works with fading and property functions.
-
tag- The sound object tag name to be used. If you want to fade the music leave thetagparameter blank, not anilvalue. This will work on fade and volume/time functions. -
duration- The duration length of the sound to fade-in, fromfromValueandtoValue. -
fromValue- An optional parameter, The starting volume of the fade; Goes from0to1; Defualt value:0. -
toValue- An optional parameter, The ending volume of the fade; Goes from0to1; Defualt value:1.
Makes the sound fade-out at the end of the sound.
-
tag- The sound object tag name to be used. -
duration- The duration length of the sound to fade-out, fromtoValue. -
toValue- An optional parameter, The ending volume of the fade; Goes from0to1; Defualt value:0.
Cancels the sound fade.
-
tag- The sound object tag name to be used.
Sets the current volume of the sound object with a new value.
-
tag- The sound object tag name to be used. -
value- The new sound volume value; Goes from0to1.
Sets the current sound position of the sound object with a new value.
-
tag- The sound object tag name to be used. -
value- The new sound position value.
Sets the determined pitch value of the sound object.
-
tag- The sound object tag name to be used. -
value- The determined pitch value. -
doPause- An optional parameter, Does a pause when a sound is currently playing.
Gets the current sound volume of the sound object current volume value; Returns a float number.
-
tag- The sound object tag name to be used.
Gets the current sound position of the sound object current position value; Returns a float number.
-
tag- The sound object tag name to be used.
Gets the current sound pitch of the sound object current pitch value; Returns a float number.
-
tag- The sound object tag name to be used.
Is the page in some way inaccurate? an error, a typo, or outdated data? To report it, use the "Issue Tab". Or do you wish to include a new function or add new information? use the "Pull Request Tab". Help is always appreciated!
- Event Callbacks
- Custom Sprite
- Custom Text
- Object Functions
- General Functions
- Scripting & File Functions
- Game Input Control Functions
- Language Translation
- HScript Functions
- Custom Substates
- Custom Shaders
- Deprecated & Removed Functions
- Sound & Music Functions
- Tweens & Timers Functions
- Reflection Functions
- Variables