r/programmingchallenges • u/huhohja • Feb 20 '18
3d Audio/Stereo spectrum in Javascript
hey guys,
I've recently started learning Javascript, and I've got an idea of which I don't know yet if it's possible.
Basically I'd like to have a 3d plane with x * y blocks on it. Using FFT you can let the y-axis represent a specific frequency band of an audio file. The z-axis (height of the blocks) will represent the amplitude of given frequency band.
So far I've been able to make this (using p5.js). The hard part is making the x-axis represent the stereo panning in some sort of way. You can think of that as a value between -1 and 1 which is defined by the difference in amplitude of the left and the right channel, in a specific frequency interval (defined by the FFT). The thing is that p5.js can't split the audio file to L/R independently, so I'll have to use the implemented Javascript Audio API, in which I have 0 experience... Does any of you guys know how you could make such a thing?
View all comments
Show parent comment
1
u/huhohja Feb 21 '18
Thanks man! I'll look into that!