Created
July 23, 2018 01:34
-
-
Save PoppyWorks/60b7b50612621797fbf69609619da220 to your computer and use it in GitHub Desktop.
GML Script. By using this after our setup_listeners(); gist, you can play audio on any listener, fade over time, and loop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///audio_play(listener,snd_filename,fade in time[ms],loop?) | |
var listener = argument0; | |
var sfx = argument1; | |
var time = argument2; | |
var loop = argument3; | |
if gamepad_is_connected(listener) | |
{ | |
sfx = audio_play_sound_on(listener, sfx, loop, 0); | |
} | |
else if listener == noone || listener == -1 | |
{ | |
sfx = audio_play_sound(sfx,0,loop); | |
} | |
audio_sound_gain(sfx,global.sfxvolume/100,0); | |
audio_sound_gain(sfx,global.sfxvolume/100,time); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment