• 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!

Legacy GM Sound not playing in HTML 5

C

Cmi

Guest
I want to play sound in HTML 5 target.

Here is my code, am not sure what is wrong with it. It works in windows just not in HTML 5.
Create Event:
execute code:

// Music on = mon
global.mon = 1;
// set the image speed to 0
image_speed = 0;
// Play the sound
audio_play_sound(snd_lvl_1,0,1)

Mouse Event for Left Pressed:
execute code:

// If on and clicked, pause
if global.mon = 1 {
audio_pause_sound(snd_lvl_1)
image_index = 1;
}
// If off and clicked, start playing
if global.mon = 0 {
audio_resume_sound(snd_lvl_1)
image_index = 0;
}

global.mon = !global.mon // toggle between on and off
 
Last edited by a moderator:

FrostyCat

Redemption Seeker
Resource IDs are not strings, stop treating them like one.

Get rid of the quotes around snd_lvl_1 in the Create event.
 
D

DifferentName

Guest
Have you tried multiple browsers? I'm getting no sound in Internet Explorer with wav sound effects. The sound works fine in Chrome, but that's having a whole other set of problems.
 
C

Cmi

Guest
Have you tried multiple browsers? I'm getting no sound in Internet Explorer with wav sound effects. The sound works fine in Chrome, but that's having a whole other set of problems.
I tried Chrome when the attributes were compressed - streamed that didn't work. I just tried Uncompressed and that one worked. Firefox didn't work. How do I make it work on all browsers?
 
S

seanm

Guest
make sure you clear the cache after you switch export modules.
 
S

seanm

Guest
what could be happening is certain audio options (compressed, not compressed, w.e) don't load the audio right away.

The sounds will probably play if you just leave your game open for a minute or two, but obviously thats not something you'd want to do.

Just change the compression options until your sounds play.

All my sounds work on chrome, ff, and ie, using the first checkbox, Uncompressed Not Streamed
 
C

Cmi

Guest
So far this is what I have:
Chrome works when attributes is Uncompressed - Not streamed
Firefox & Chrome both work when attributes is Compressed - Not streamed
 
S

seanm

Guest
You've cleared the cache, and you are using the most up to date versions of the browsers?

Also check what your webGl settings are in the global settings menu. I just leave mine on auto and everything works fine.
 
C

Cmi

Guest
You've cleared the cache, and you are using the most up to date versions of the browsers?

Also check what your webGl settings are in the global settings menu. I just leave mine on auto and everything works fine.
you mean in my global game settings right?
 
S

seanm

Guest
Yeah, global game settings, html5, graphics. Make sure auto detect is on.
 
C

Cmi

Guest
Yeah, global game settings, html5, graphics. Make sure auto detect is on.
I read somewhere that it is good to have WebGL set to required because it makes your game run the way it is supposed to run.
 
C

Cmi

Guest
it also means audio won't always work
Oh okay, I turned it on. But so far everything is going pretty good. You won't happen to know a good tutorial on loading screens. ( I know it's off topic :/ sorry)
 
D

DifferentName

Guest
Turns out my sound effects are ogg in the HTML5 export (Uncompressed, Not Streamed). I already had webGL set to auto detect and it doesn't seem to make a difference to the sound in Internet Explorer. Turns out that's the cause of some of the graphics problems I'm seeing though!
 
C

Cmi

Guest
Turns out my sound effects are ogg in the HTML5 export (Uncompressed, Not Streamed). I already had webGL set to auto detect and it doesn't seem to make a difference to the sound in Internet Explorer. Turns out that's the cause of some of the graphics problems I'm seeing though!
Would you recommend I make all my sounds ogg?
 
D

DifferentName

Guest
No. I still don't have sound in Internet Explorer. Still trying to figure out what's happening there.
 
Top