Skip to main content

The "vngen_audio_play_sound" Function

Syntax#

vngen_audio_play_sound(id, sound, volume, fade, [ease], [loop]);
ArgumentTypeDescription
idreal/stringThe unique identifier to use for the new sound
soundsoundThe sound resource to play
volumereal (0-1)The sound volume, where 1 is default and 0 is silent
faderealThe length of time to fade sound in, in seconds
[ease]integer/macroOptional: Sets the ease mode to perform the fade in
[loop]booleanOptional: Enables or disables endlessly looping the sound (disabled by default)

Description#

Plays a new sound effect with an optional fade in and volume control. Sound effects are the most generic type of sound in VNgen and can be looped or played once and will be paused if vngen_toggle_pause is run. Looped audio actions will be marked complete immediately and will not delay the next event until any fade transition is complete.

See Macros & Keywords for a list of available ease modes.

Example#

vngen_event() {
vngen_audio_play_sound("explode", snd_explosion, 1, 0, ease_none, false);
}