In this demo, the audioMotion-analyzer object is instantiated within a function triggered by a user click. This method prevents the "The AudioContext was not allowed to start" warning message in the browser console and also ensures that the AudioContext is started before any attempt to play audio.
audioMotion-analyzer automatically starts its AudioContext on the first user gesture it detects, but be aware
that clicks on native controls of <audio>
or <video>
elements cannot be intercepted by JavaScript.