MFGG Forums
(solved) audio_sound_gain not working on included audio files - Printable Version

+- MFGG Forums (https://forums.mfgg.net)
+-- Forum: MFGG (https://forums.mfgg.net/forumdisplay.php?fid=4)
+--- Forum: Developer Discussion (https://forums.mfgg.net/forumdisplay.php?fid=10)
+--- Thread: (solved) audio_sound_gain not working on included audio files (/showthread.php?tid=1222)



(solved) audio_sound_gain not working on included audio files - smbmaster99 - 08-06-2018

EDIT: Nevermind rofllllllll i don't understand WHY but changing the time argument in the audio_sound_gain() function from 1 to 0 fixed it lol


Hey there, my problem is pretty much in the thread title. I've been using
Code:
audio_sound_gain(index, volume, time)
for a while now for some ambient sound effects in my project with no problems, but i decided to add further ambient sound effects as included files. I'm using
Code:
audio_create_stream(filename)
to load and play the sound effects. I get the sounds to play just fine, but now the audio_sound_gain function doesn't work on them anymore - now sounds like a creek are locked at 1 (max volume/gain) instead of fading smoothly from 0 to around 0.5 for example (based on distance to the player). Essentially, the audio_sound_gain function doesn't seem to work anymore now that i've moved some of the larger ambient sound effects to included files

Can anyone help?


RE: (solved) audio_sound_gain not working on included audio files - ReinlynxPSI - 08-09-2018

(08-06-2018, 09:18 PM)smbmaster99 Wrote: EDIT: Nevermind rofllllllll i don't understand WHY but changing the time argument in the audio_sound_gain() function from 1 to 0 fixed it lol

My guess is that it works like the alarm events; the 0th frame is the "trigger" frame, which means that setting the step count to 0 sets it to the trigger frame without it activating.


This forum uses Lukasz Tkacz MyBB addons.