No sound in Safari (find in chrome and firefox) - P5 Oscillator

Hi All,

I have a project creating a synthesiser with a step sequencer which works perfectly in Chrome and Firefox - In Safari however there is no sound at all. All the functionality seems to be working just no sound… I have the latest version of P5 sound and cannot find any thing on here that can explain… there are no errors in the console so i have no idea where to start debugging.

1 Like

Hello, and welcome @bedlamagogo!

I think you’ve stumbled upon the user-must-interact-before-sound-can-be-played-feature. :blush:

1 Like

Thanks for the welcome Sven :slight_smile:

I might be missing something as not sure what you mean by user must interact - there is a button called start/stop which calls a method to begin - would this be what you mean by user must interact

Yep, a start/stop button is the solution. But your sketch is trying to do something with audio before the user has interacted (pushed that button). I get the following warning in Chrome’s JavaScript console when running your sketch:

The easiest solution is to use userStartAudio() – theres an example in the p5.js Reference.


Thanks so much for that it certainly helped with safari - I have some other issues in chrome to debug but that was a great help