// How the sound fades out over time. Play with the numbers and see what works for your game.
global.falloff_ref = 100;
global.falloff_max = 300;
audio_falloff_set_model(audio_falloff_linear_distance);
audio_listener_position(view_xview[0] + (view_wview[0] / 2), view_yview[0] + (view_hview[0] / 2), 0);
audio_listener_orientation(0, 0, 1000, 0, -1, 0);
audio_play_sound_at(snd_sound, x, y, 0, global.falloff_ref, global.falloff_max, 1, false, 1);