Juce_emscripten audio input support

The JUCE emscripten WebAssembly port allows audio playback via OpenAL in the webbrowser. Is there an easy way to integrate audio input too (single channel default microphone recording) and can we expect such a feature in the next juce_emscripten releases coming up?

1 Like

is there a supported juce running on wasm?

nice !
it would be nice if emscripten / wasm was a supported platform by juce itself instead of being a separate project that if not actively developed will become obsolete


I am in favor of this as well.

The reason is that I am trying to create a looper beatboxing app. Beatboxing is still a new and upcoming form of music and the (only) way to use looping in Beatboxing currently is the BOSS RC-505, which is costly and unavailable in some countries. Creating an app that can be used on a large variety of devices (and that hopefully works from a web page) would make looping accessible to virtually any beatboxer wanting to try it out. The dream would be seeing people jamming and creating songs just by using their mouth, phone and headphones!

Beatboxing, for me at least, requires a maximum of 3 ms of latency, and currently, I’m seeing two solutions to this problem. Either create a standard JUCE app or create a React PWA that uses JUCE emscripten as an audio backend.
The React PWA option sounds way better IMO because any beatboxer could instantly use the app in their browser from any device and, if they like it, add the app to their device from the browser. The only missing puzzle piece is the audio input for JUCE emscripten. Usually, I would not use JUCE at all for this task, but the Web Audio API doesn’t use the lowest latency drivers on all devices. For instance, it uses WASAPI on Windows, which has a latency of >= 10 ms. I have tried to use it on a couple of sample sites and I have tried to turn exclusive mode on (which should lower latency), but to no avail.
I am currently thinking about creating a React PWA with the Web Audio API as an audio backend and replacing it with JUCE emscripten when it starts supporting audio input. In a perfect scenario, the app would have some kind of effect plugin support as well, but it is too early to say what this would look like.