While I understand this behavior from Apple in a user-first perspective and do find audio on mobile web to be annoying in most cases, an easy way to allow audio to play on an iPhone that isn't "use a desktop" seems to be flipping the hardware switch to turn off silent mode.
I'm not proud to admit it took 5 minutes of poking and a Google/Gemini search to figure that out...
After a lot of trial and error, I've taken to putting a button on any page I make that uses audio with the label "Click here to unmute". Have it play a silent audio clip when it's pressed. After that, audio works.
The UI on this page should work fine on ios if the big red play button simply plays audio directly via webaudio. Who knows how it's actually coded though. It looks like an LLM's work. Probably a mess.
Also, here's the author's AI policy: https://www.joshwcomeau.com/ai-policy/
They're also a somewhat active user here.
I would find it frustrating if my phone was set to silent and it played button noises on a website.
FYI, setting `navigator.audioSession.type` to `"playback"` will allow the sounds to play on iOS even when silent mode is on. (It defaults to `"ambient"`.)
On iOS versions below 16.4, this won't work as reliably; there are hacks you can do with `AudioContext`^[1] instead.
For me this website spins up the fans on my M4 Pro Mac mini when running it in Firefox Developer Edition.
Ironically, I think it's the "Whimsical Animations" ad banner.
This is impressive, nice work, thanks for this contribution! A writeup on this process specifically could be intriguing. Just to clarify, I understand you've chosen to license the sounds themselves are under the MIT license?
https://www.youtube.com/shorts/o_n5W2I2p_M
Switch Courtesy of the Amsterdam Bakelite Collection:
https://www.amsterdambakelitecollection.com/collection.php
Majestic Stone Zen Garden Gorilla Courtesy of Boeddha Beelden: