p5.js sound does not work in Chrome and Safari but works in Firefox

Hi, I am a new member here, and I probably miss a detail...but I prepared an audio survey and I've tested it offline in P5js and Firefox works properly, while it doesnt work in Chrome, Safari... I already tested P5.js online examples and I recently updated the libraries (p5.sound.js)

BTW, I have this code for a "PLAY/PAUSE" button

function togglePlaying() { if (!song.isPlaying()) { song.play(); button.html("pause"); } else { song.pause(); button.html("play"); } }

any suggestion... ? many thanx T

Tagged:

Answers

  • I've tested it offline in P5js and Firefox works properly, while it doesnt work in Chrome, Safari.

    @theotrst - this is a FAQ: check your console (F12) in Chrome and you'll probably see a message warning about browser security restrictions. To test locally you should ideally run a local test server...

Sign In or Register to comment.