Getting Audio Visualizations Working with Web Audio API
dwayne.xyz
dwayne.xyz
One of the next few things I want to work on is more interesting visualization options.
Just so you know, I got an error when trying to use the mic on mobile Safari when using your live demo. this.audioCtx was null when calling .createMediaStreamSource.
A few possible next steps I had in mind:
(1) Turning those ACFs into actual shapes, not just colored rings assembled together, so say an accord on piano would create a sophisticated 2d or 3d shape with elaborate structure. Perhaps, just mixing the flat ACFs with an exp decay would achieve the result.
(2) Visualizing the ACF heights map as a water surface with a raytracer. This sounds nonsense until you see a few real (physical) examples: "cymaglyphs". Those are reflections and refractions on the rippled water surface that's assuming shapes of the so-called Faraday waves (a parametrically driven wave equation, see "Numerical simulation of Faraday waves" by L. Tuckerman on arxiv). However this requires solving a complex diff equation + an extremely high quality raytracer, as otherwise you'd get blurry pixelated images. None of the existing raytracers would work here.
As for compatibility with other browsers, it works on desktop Chrome and Firefox, but not on their mobile versions. I haven't figured out yet why. Must be something to do with GPU differences. Safari is a whole another story. The visualizer uses WebAudio + WebGLv2, and Safari isn't known for supporting the bleeding edge standards. While you could do everything without GPU, it would crawl at 0.03 fps and you wouldn't be hear and see sound in real time.
https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_A...
Working on Chrome Version 86.0.4240.80 (Official Build) (x86_64) same machine
On Chrome, the mute button defaults to the muted state and never responds to a click. Pause/play always works to toggle the animated display with every click.
On Safari, the pause button is unresponsive. The mute button toggles the animated display with every click, and changes state between muted and unmuted. When muted, animation is paused. When unmuted, animation is active. When muted and animation paused, a click on the play button does not change the paused animation state, but does result in the triangle symbol displaying smaller during button down, then restore to larger when button up. Sometimes I can get the play button to work (toggle animation on/off) after clicking in the progress bar a number of times and toggling the animation state that way, after which (sometimes) the play button works, but not always.
Also, the display of controls is different on Chrome than Safari.
Chrome, progress bar is a full width bar underneath the other controls.
Safari, progress bar is in line with the other controls, which include -15 and +15 either side of Play. Those skip controls are not present on Chrome.
It sounds like you're describing some cross browser issues playing that mp4 file.
Thanks for the feedback though. I'll try to reword that section so it's more clear.