- Contents:
Any volume value here is always between 0
and 1
.
- Initializes the audio subsystem of Sugar.
- Is called by
init_sugar(...)
.
- Shuts down the audio subsystem.
- Is called by
shutdown_sugar()
.
- Loads the file at
filepath
as the sound effectid
. - If
id
isn't set, the next available numeral sfx id is used. volume
will only be applied on this sound effect. It is multiplicative withsfx_volume(v)
.- Returns the sound effect's id.
- Loads the file at
filepath
as the musicid
. - If
id
isn't set, the next available numeral music id is used. volume
will only be applied on this music. It is multiplicative withsfx_volume(v)
.- Returns the music's id.
- Sets the volume for sound effects. (
0 - 1
)
- Sets the volume for music. (
0 - 1
)
- Unloads the sound effect
id
.
- Unloads the music
id
.
- Plays the sound effect
id
. - If
distance
is set, volume is decreased accordingly. - If
setreo_angle
is set, the sound effect is directed accordingly in stereo. (0
is center,-0.25
is left,0.25
is right) - If
pitch
is set, the sound effect is pitched accordingly.0.5
is down an octave,2
is up an octave.
- Plays the music
id
. - If
loop
istrue
, the music will start over after it ends. - Call
music()
with no arguments to stop the playing music.