hi, I have a sketch where sounds are playing automatically when the sketch it launched and then the user can adjust volume.
However, no sounds are playing when I open the sketch online via iphone.
does anyone know how to successfully allow p5 sounds to play on mobile?
Thank u !
Some browsers, like Safari on iOS, won’t play audio unless the user interacts with the page first, like tapping a button. To successfully play audio in those browsers, you could add a “Press to play” button and start playing audio after the user tapped it.
From Apple’s Safari HTML5 Audio and Video Guide:
Note: On iOS, the Web Audio API requires sounds to be triggered from an explicit user action, such as a tap.
okay, that makes sense. I will try thank you !