Skip to main content

The "vngen_audio_play_music" Function


vngen_audio_play_music(id, sound, volume, fade, [ease], [start, end, full]);
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
[start]realOptional: Sets the starting point to clip the sound, in seconds
[end]realOptional: Sets the ending point to clip the sound, in seconds
[full]booleanOptional: Enables or disables playing from beginning before clipping

Clip arguments are a group. All three must be input together, or not at all.


Plays a new music track with an optional fade in, volume control, and real-time loop clipping. Music is always looped and will not 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.


vngen_event() {
vngen_audio_play_music("music", mus_battle, 1, 0.5, ease_sin_out);
vngen_audio_play_music("music", mus_battle, 1, 0.5, 5, 20, true);