• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

HTML5 Playing sounds isn't working.

LOLASO

Member
Hi! im making my game for the Opera GX Game Jam. I am trying to play sound with the audio_play_sound function and it doesn't works. Can someone help me? Thanks!
 

FrostyCat

Redemption Seeker
You can't play sound on the HTML5 export unless it has been preceded by some sort of input, e.g. a mouse click on the canvas. This is a limitation imposed by browsers to prevent intrusion from auto-played audio. Set up a "click anywhere to begin" screen, and play audio only after that click has registered.
 

LOLASO

Member
You can't play sound on the HTML5 export unless it has been preceded by some sort of input, e.g. a mouse click on the canvas. This is a limitation imposed by browsers to prevent intrusion from auto-played audio. Set up a "click anywhere to begin" screen, and play audio only after that click has registered.
I put this code and it doesn't works to. (The object is presistent too)
GML:
if mouse_check_button_pressed(mb_left)
{
    room_goto_next();
    audio_play_sound(Music_Space, 10, true);
}
 
Top