Share audio buffer between processes (windows)

71 Views Asked by At

I want to allow feedback loops in VSTHosts that do not support feedback loops, but do support custom audio routing between audio nodes. Such an example is FLStudio's Patcher.

The way these audio nodes work is by being given a buffer to work with, and writing the result back out. The buffer size is set by the host.

There are 2 problems I am facing, handling plugin delay and sharing buffers across processes.

The way I'm currently looking at the solution is having a Sender process which reads the incoming singnal and also forwards it, and a Receiver process which consumes from one selected Sender.

Because custom audio routing is supported, this setup achieves feedback loop given some audio node which can merge 2 sources.

Sharing memory between processes has been asked already a few times. Now I am querying information related to this topic prior to implementing and testing some stuff specifically targeting audio processing because I might look into the wrong direction. I might not necessarily need to "share memory", but rather send and capture streams via some other windows api feature that I don't know of.

Given that I need this to be realtime, what audio sharing options do I have available for windows?

I recently stumbled upon DirectShow Filters, a deprecated windows feature, Audio Video Capture Feature and Source Reader however I still don't know if this is the direction I need to be heading at.

1

There are 1 best solutions below

0
On

Sharing memory in Windows is done via the File Mapping API., particularly this. The other APIs you are mentioning have nothing to do with sharing memory (or anything else) between processes.

That said, the Core Audio API has mechanisms for loopback (that I use it in my own sequencer and implementation of the ASIO driver) so perhaps this may help you.