3 ms·
Somehow I have memories of the 1990s and audio visualisations coming back... Fantastic. I'd love to be able to plug this into mpv for playing audio files. I won
by hiisukun 6y ago
Somehow I have memories of the 1990s and audio visualisations coming back... Fantastic. I'd love to be able to plug this into mpv for playing audio files. I wonder how hard this would be (or how many resources it would use...).
I really enjoyed your work: the write-up was clear and the demo page worked well.
- gbh444g 6y agoFor visualization, you'd want to take at least 20 sound samples per second, each sample about 0.1 sec long, so they would overlap a bit to capture freq/amp modulations. With the typical 44,100 Hz sample rate, 0.1 sec would be an array of 4410 float32s. Round that down to 4096. Then you run FFT twice over this input: that's Nlog2(N), N=4096. So you have about KN log2(N) ops/sec, with K=20, N=4096 that's 1 million flops. Updating pixels of the 1000x1000 image would be another 1 Mflops. Well, brightness adjustment to the 3 sigma range is another pass and another 1 Mflops. I know for a fact that this thing can draw 1024x1024 images at 60 fps on pure javascript, but if you don't like the noise of CPU fan, you'll have to write it in GLSL.