Skip to content

Repair to the audio in the p5.func "easing3_animation" example#5

Open
golanlevin wants to merge 1 commit intoIDMNYU:masterfrom
golanlevin:master
Open

Repair to the audio in the p5.func "easing3_animation" example#5
golanlevin wants to merge 1 commit intoIDMNYU:masterfrom
golanlevin:master

Conversation

@golanlevin
Copy link

The synthesized audio aspect of the easing3_animation demo is very compelling and economical. The audio in this demo no longer works because of browser policy changes regarding audio. For example, running the official online demo at IDMNYU in Chrome produces the error:

The AudioContext was not allowed to start. 
It must be resumed (or created) after a user gesture on the page.

A repaired example can be found online here and in this pull request. Changes include:

  • Bumping p5.js and p5.sound.js from 0.5.16 to 1.10.0; removing p5.dom.min.js (no longer used)
  • Adding getAudioContext().suspend(); in setup()
  • Adding the newish userStartAudio(); function in mousePressed().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant