mattdesl / audiograph.xyz

A visual exploration of Pilotpriest's 2016 album, TRANS.
Other
333 stars 40 forks source link

POC fix for audioContext issue #3

Closed handeyeco closed 2 years ago

handeyeco commented 5 years ago

This is a quick hack, but I wasn't sure if anyone was interested in maintaining this repo anymore. I thought I would create a POC to see if there was interest.

The Problem

Google implemented a non-standards change to the Web Audio API that required users to interact with a site before allowing audio (of course giving their own sites an exception to this rule). This prevented audiograph.xyz from working as expected because when audio tried to play on load, it gets blocked.

A Possible Solution

For the POC, I just added a button before the setup script. It looks like Matt may have commented out some code related to playing on desktop, so I uncommented those out (now that the Web Audio API could do its thing).

Screen Shot 2019-10-01 at 10 21 13 AM Screen Shot 2019-10-01 at 10 21 25 AM

Not super elegant, but I made the changes so I could show my friend this incredible project.