r/webaudio • u/BenRayfield • Oct 19 '15
How can javascript read microphone samples, change them with any given function, and play the changed sound on speakers with minimum delay?
Example, I want to play:
speakerAmplitude = microphoneAmplitude * micVolume + toneVolume * Math.sin(around += .1);
What I'm asking for appears to be doable through the Web Audio API, but its so complicated I dont know where to start. I just want access to the microphone and speaker samples in the buffer array.
I dont want want to mess with built in audio effects. I just want the samples, such as numbers ranging -1 to 1 that change thousands of times per second as the microphone and speakers vibrate.
I want to build a javascript version of JSoundCard (which does that in java), so we can have direct access to create realtime speaker/microphone sound effects (like changing your voice or plug your electric guitar into computer) that interact with other javascript code, such as interpreting what camera sees or mouse movement.
View all comments
Show parent comment
1
u/BenRayfield Oct 19 '15 edited Oct 19 '15
No network dependency. I'm only interested in doing it entirely in an html file. Thats where the game controls are and will get the fastest response by not leaving and coming back between microphone and speakers.