Riff / Built on the open web / Media
Web Audio
Reads the signal that lights the filament.

How Riff uses it
The first time something plays through the audio element on a non-iOS browser, the script creates an AudioContext. It wraps the element in a media source and connects it through an analyser and back to the destination, so the sound still comes out. The context suspends on pause and resumes on play.
Why
This is what drives the amber filament. On iOS the graph breaks lock-screen and background playback, so iPhones are left out.
Without it
Where there is no analyser the wire breathes at working temperature on a fixed loop instead.
Where
- plugins/riff/assets/riff.js, line 544
const ctx = new AudioContext(); - plugins/riff/assets/riff.js, line 545
const src = ctx.createMediaElementSource( audio );
Links open the source at the commit this page was published from.
Reference: Web Audio on MDN.