1 | function scr_audio_fade_out |
2 | { |
3 | var snd = argument0 |
4 | var fade_len = argument1 |
5 | if (!audio_is_playing(snd)) |
6 | return false; |
7 | audio_sound_gain(snd, 0, fade_len) |
8 | if instance_exists(obj_audio_fade_helper) |
9 | { |
10 | with (obj_audio_fade_helper) |
11 | { |
12 | if (audio_to_fade == snd) |
13 | return false; |
14 | } |
15 | } |
16 | with (instance_create(0, 0, obj_audio_fade_helper)) |
17 | audio_to_fade = snd |
18 | } |