HTML5 No sounds heard on html5 mobile

henmartz

Member
I am using version 1.99.550 of early access and everything runs smoothly with my game html5 on the computer, however when I test it on mobile I do not hear the sounds, I think the problem is in the configuration of my sounds, as I should To correctly set up sounds for playback on mobiles?
 
I am using version 1.99.550 of early access and everything runs smoothly with my game html5 on the computer, however when I test it on mobile I do not hear the sounds, I think the problem is in the configuration of my sounds, as I should To correctly set up sounds for playback on mobiles?
Hi henmartz, answering here so that others can respond / see what's said if they have similar issues.

It's been a little while sInce I delved down the rabbit hole of audio for html5. But if your issue is specifically with ios devices, you need to have audio started using a release mouse from the player. Sounds like you have done this so I have two more thoughts.

1) Are you using the new audio engine or legacy? If you delve into the manual here https://docs.yoyogames.com/source/dadiospice/002_reference/game assets/sounds/audio_system.html you can read all about testing and moving between the two.

2) I've not used 1.99, as I jumped from 1.4 to 2, so I don't know if this was resolved or not - https://forum.yoyogames.com/index.p...-not-work-on-ios-10-3-beta.22958/#post-173636

Failing all this, post your (audio) code and I'll see if I can suggest anything else :)
 

henmartz

Member
Many thanks for replying friend: D, I was almost to collapse, if I am using the new audio engine, I put this code in the create event of my obj_button.

if audio_system() == audio_old_system
{
global.SS = false;
}
else
{
global.SS = true;
}

Another observation is that I am using mp3, the properties of mp3 in game maker are: compressed - Not Streamed, Mono, 16 bit, Sample Rate 48000, Bit Rate (512)
Is it well set up ?? Should I use mp3 for audio playback?

Here I leave the gmz where I do the test to discover the solution of the audio.
https://drive.google.com/open?id=0BwVLBZkfOlrhOWczU2cxZDNZRUk
 

henmartz

Member
Okay I just understood well and update my code.
In the create event of the obj_button I put
if audio_system() == audio_old_system
{
global.SS = false;
}
else
{
global.SS = true;
}

And in the event left released
if global.SS == false{
sound_play(sndtest);
}else{
audio_play_sound(sndtest,5,false);
}

It is right? I will continue to test any progress I will inform you :)
 
Okay I just understood well and update my code.
In the create event of the obj_button I put
if audio_system() == audio_old_system
{
global.SS = false;
}
else
{
global.SS = true;
}

And in the event left released
if global.SS == false{
sound_play(sndtest);
}else{
audio_play_sound(sndtest,5,false);
}

It is right? I will continue to test any progress I will inform you :)
Just downloaded and had a quick look at your test project - you are using mouse left pressed event. Try it with global mouse left released event and see if that works...
 

henmartz

Member
After reviewing this forum many times I could understand https://forum.yoyogames.com/index.php?threads/touch-input-does-not-work-on-ios-10-3-beta.22958/

I returned to download the stable game maker version (version 1.4.1763) after compiling the game in html5, go to the game folder, then to the html5 folder, and search for project_name.js, open it in a text editor that Have the option to search.

You have to look for the following line:
if(window.hasOwnProperty('AudioContext')&&(!window.hasOwnProperty('webkitAudioContext')||window.webkitAudioContext.prototype.createGainNode===undefined)){window.webkitAudioContext=AudioContext;

Replace with:
if(window.hasOwnProperty('AudioContext')||(window.hasOwnProperty('webkitAudioContext')&&window.webkitAudioContext.prototype.createGainNode===undefined)){if(window.hasOwnProperty('AudioContext'))window.webkitAudioContext=AudioContext;else window.AudioContext=webkitAudioContext;

My problem is that I did not know where to find the .js file.
The audio and touch work perfectly on both platforms, thanks for the help michael bateman made me understand many things that I would not have understood it alone, I appreciate the help a lot :)
 
Top