• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 SCRIPT5007: Unable to get property 'gain' of undefined or null reference

T

Tomi Kokkonen

Guest
Hi, I tested my games build on Internet Explorer and got following error on each frame
SCRIPT5007: Unable to get property 'gain' of undefined or null reference
[game_name].js (936,268)
The error comes from following function
Code:
// release build:
function _9e(_Y01){if(_Y01==0){return _b_.gain.value}return 0}
// development build
function audio_get_master_gain(_C01){if(_C01==0){return _FZ.gain.value;}return 0;}
What could possibly cause this? Is it a bug in Game Maker that I should report?

-Tomi
 

chmod777

Member
Hi,

Internet Explorer does not support the Web Audio API, so all audio_* functions will not work...
However they should fail silently (like the audio_play_sound() does for example). But audio_get_master_gain() does not check if the browser supports the Web Audio API, which causes the error.

If the audio_system() function still exists in GMS2, you could create a custom script "audio_get_master_gain_custom" as a workaround:
Code:
if(audio_system() == audio_new_system) return audio_get_master_gain(argument0);
else return 0;
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
What could possibly cause this? Is it a bug in Game Maker that I should report?
However they should fail silently (like the audio_play_sound() does for example). But audio_get_master_gain() does not check if the browser supports the Web Audio API, which causes the error.
Yep, that sounds like it shouldn't happen. Please report it and include a download link to an example file that shows the problem. Thanks!
 
Top