Closed marcelblum closed 3 years ago
i was wondering that too
In case anyone comes across this I wanted to post the results of my r&d. The best way to get Web Audio raw PCM output buffers in realtime seems to be via an audioWorklet
, which is actually a pretty simple low latency method and no need to mess with MediaStreams at all. In Electron you can call Node modules directly from within worklets as long as nodeIntegrationInWorker
is true
so all the audio routing work can be done on its own thread if you want to use something like naudiodon.
Is it possible to pipe audio generated in realtime by the web audio api in an Electron app to naudiodon with minimal latency? I imagine it can be done with maximal latency by using
createMediaStreamDestination
andMediaRecorder
to write the web audio api output to an intermediary file which is then piped to a naudiodon instance. But is there a better more direct way to pipe raw audio data from aMediaStream
into naudiodon? How are folks using this lib in Electron?