• 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!
  • 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 iOS HTML5 audio

chmod777

Member
Yeah, that's an old issue. It did happen in Chrome with Android but not in the last release (for some reason). I don't think this is really a bug as "compressed - streamed" sounds add a <audio> tag to the DOM, with an autoplay attribute and we know that most mobile browsers (excepting Firefox) prevent audio to be played in this situation. But I agree a workaround should be found by the guys at YoYo.

EDIT: What I've said about the last Chrome release is not exactly true, even if it seems they've changed their policy about audio:

It seems that desktop Chrome is going to take the same route than mobile browsers about audio in HTML5. In Chrome Canary:


This error happens:
- when the game is iframed AND iframe and parent domains are not the same.
- when you access the game directly with the url bar (no browsing before).

This means audio won't be played in stable Chrome soon.
 
Last edited:
S

Sam (Deleted User)

Guest
Thanks everyone for verifying this was a bug. I remember for some period of time in the past iOS itself didn't allow audio. It's nice to hear that apparently Apple has changed how they do things in this regard.
 

True Valhalla

Full-Time Developer
GMC Elder
https://bugs.yoyogames.com/view.php?id=29360

"This issue was originally reported as being a problem with Compressed - Streamed audio, however this issue replicates with Uncompressed - Not Streamed also (which is the default audio type)."
Personally, I have not had any issues with Uncompressed - Not Streamed audio in Safari (aside from requiring that initial user touch input before playing sound). I'd be curious to know which circumstances this was replicated in with Uncompressed - Not Streamed audio.
 

FrostyCat

Redemption Seeker
Personally, I have not had any issues with Uncompressed - Not Streamed audio in Safari (aside from requiring that initial user touch input before playing sound). I'd be curious to know which circumstances this was replicated in with Uncompressed - Not Streamed audio.
You can see in the ticket from Nocturne's post that the reproductions are mainly in Chrome --- current release versions of iOS Chrome and also beta versions of desktop Chrome.
 

True Valhalla

Full-Time Developer
GMC Elder
That makes sense. I'm not as concerned about iOS Chrome, but the desktop Chrome beta has definitely got me worried.
 

Ricardo

Member
Is this fix available in 2.1.5 and runtime 2.1.5.246? I can't play sounds on iOS 11.4.1 no matter what (both Safari, Chrome and all kind of attributes for the audio files).

Edit: my bad, I managed to get it working.
 
Last edited:

Ricardo

Member
I'm having an issue with the fix 0029360. The release notes says "NOTE 2: This change does mean initial loading times for HTML5 will now be longer while the audio files in your game are downloaded".
The audio files are downloaded at the beginning no mater what (even when they are marked as streamed) in iOS mobile and Android default browser (this does not happens in Chrome for Android nor desktop browsers).
The issue with this is that a project of mine with a huge amount of audio files crashes Safari Mobile as the amount and size of the files is really high. This is not an issue in Chrome for Android,though, as the sounds are streamed and doesn't blow the memory. There is a workaround to avoid streamed files to be preloaded?
 

True Valhalla

Full-Time Developer
GMC Elder
The issue with this is that a project of mine with a huge amount of audio files crashes Safari Mobile as the amount and size of the files is really high
You should report this. Forcing streamed audio to download during loading seems like a bandaid solution, and effectively makes it impossible to include more than a few minutes of audio in HTML5 games.
 

Ricardo

Member
You should report this. Forcing streamed audio to download during loading seems like a bandaid solution, and effectively makes it impossible to include more than a few minutes of audio in HTML5 games.
Yeah, I don't know who had that brilliant idea... It is definitely a bad bandaid fix. Is not just because that solution works in a small game that it should be implemented as default. Streamed sounds have a very specific reason to exist.
 

True Valhalla

Full-Time Developer
GMC Elder
Yeah, I don't know who had that brilliant idea... It is definitely a bad bandaid fix. Is not just because that solution works in a small game that it should be implemented as default. Streamed sounds have a very specific reason to exist.
Have you successfully used streamed audio in the past (GMS1 or GMS2)? I always encountered compatibility issues across various platforms (especially mobile) and have been using Uncompressed instead. Streamed audio never seemed fully functional...

For my major Kingfall, which will include a full soundtrack and 100's of sound effects, we're planning to implement our own external audio system because the built-in HTML5 audio system is so inflexible and unreliable (partially due to the glacial pace of GMS2 updates).

I can't believe it's been half a decade since the HTML5 beta and I'm still dealing with this 💩💩💩💩. HTML5 audio is a nightmare.
 

Ricardo

Member
Have you successfully used streamed audio in the past (GMS1 or GMS2)? I always encountered compatibility issues across various platforms (especially mobile) and have been using Uncompressed instead. Streamed audio never seemed fully functional...

For my major Kingfall, which will include a full soundtrack and 100's of sound effects, we're planning to implement our own external audio system because the built-in HTML5 audio system is so inflexible and unreliable (partially due to the glacial pace of GMS2 updates).

I can't believe it's been half a decade since the HTML5 beta and I'm still dealing with this ****. HTML5 audio is a nightmare.
Not really, streamed sounds were always unstable on my HTML5 projects and I always use Compressed sounds + Audio Groups (and then carefully load/unload). That have been working great for me.
Currently I'm working on a project in which Streamed sounds will fit like a glove, though; and that's why I am investigating.

Edit: just to you have an idea: I'm currently working with a VN that right now has 2575 audio files. Music, SFX, VA... It is a nightmare to get this working in a mobile device.
 
Last edited:

Ricardo

Member
@True Valhalla YoYo's answer about streamed sounds: Thanks for reporting this, but it's not a bug or something we need to address, as we have no plans to change this since most browsers now don't actually support streamed audio and so this was a mandatory change that would have been made at some point regardless. You'll need to start using audio groups and managing audio properly when you start your application to avoid crashes like this from happening. :rolleyes:
 

chmod777

Member
@True Valhalla YoYo's answer about streamed sounds: Thanks for reporting this, but it's not a bug or something we need to address, as we have no plans to change this since most browsers now don't actually support streamed audio and so this was a mandatory change that would have been made at some point regardless. You'll need to start using audio groups and managing audio properly when you start your application to avoid crashes like this from happening. :rolleyes:
Thanks for sharing their answer which is not really acceptable.

It's just that most browsers now require a user gesture before playing any sound that has an "autoplay" attribute - and it's only for the first sound. The new Chrome policy (desktop and mobile) seems to be a lot better for fair developers.
The only issue with that would be with iOS I think - as usual.
 

Ricardo

Member
They have a very efficient way to deal with customer requests: "we have no plans to change this". I'd love that my life, as a programmer, was as easy of just say that every time I needed to address an issue.
 

True Valhalla

Full-Time Developer
GMC Elder
This response really justifies my earlier decision to roll our own audio engine for Kingfall, which we're actively working on now. I'd recommend you do the same.
 

rmanthorp

GameMaker Staff
Admin
GameMaker Dev.
Hey, just want to jump in and say we are working to keep up with audio on HTML5 but it's a constant fight and with the changes we do fall behind. It's not the case that just interacting with the screen in some way is a fix. Streaming audio just seem to have issues all over on mobile now. Looks like they are pointing towards all sounds being downloaded but it's not even clear. However, we are not giving up trying to address this. Thanks.
 

Ricardo

Member
Hey, just want to jump in and say we are working to keep up with audio on HTML5 but it's a constant fight and with the changes we do fall behind. It's not the case that just interacting with the screen in some way is a fix. Streaming audio just seem to have issues all over on mobile now. Looks like they are pointing towards all sounds being downloaded but it's not even clear. However, we are not giving up trying to address this. Thanks.
This is something in the past I'd probably see as "okay". The most I work professionally with GMS2, the more I get worried, though. In my opinion, YoYo needs to find a new and more efficient way to deliver key hotfixes to support Indie and small studios. One update each 3-4 months is not the way to go and you guys will be always "fall behind".
 
Top