MacOS Audio: Multiple outputs with AUGraph API using Subgraphs?

Audio Units and AUGraphs are based on a “pull” model. Each output pulls input through the graph at its desired rate.

For two unrelated outputs (e.g. 2 USB audio devices using 2 separate oscillator chips or crystals), that could mean 2 slightly different sample rates, even when both are configured for 44.1k (etc.). And a single graph can only run at one rate.

You could try installing a tap on one of the audio unit outputs, copying its output samples into a circular buffer, and pulling from that fifo buffer for the second audio output unit. An appropriate errors concealment strategy for the sample rate mismatches (eventually causing underflow or overflow issues) may be required.

Source link