Large Audio ArrayBuffers Crashing iOS Safari

We are noticing that large audio files that are loaded into the Sound constructor as an Array Buffer cause iOS Safari to crash, 100% of the time. This is a 9MB mp3 file.

I know iOS Safari is the hell of all hells, but wanted to see if this was a bug on your side or if there are ways we can handle this better? Repro link below.

Sounds not ready to play | Babylon.js Playground (babylonjs.com)

i just tried loading the playground and it played the audio correctly on an iPhone 12 with iOS 16.1.1. Does it crash after some time, or directly when loaded?

2 Likes

Hmm :thinking:, interesting @RaananW . For me, the page first immediately crashes then reloads. On reload, the page is often stable and I can see the audio button that appears on iOS in the top left corner to mute/unmute the audio. Clicking it does nothing and I can’t hear the audio.

Will test with a few other teammates who have iOS devices and report back!

iOS usually crashes the page when it is using too much memory, which i would assume is the case here as well. if it is device dependent and only newer devices support it, it might be the case here.