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

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.
 

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