1

I am reading about Audio Units on OSX, but it's not totally clear to me what an Audio Unit is.

I would like to insert custom audio processing in any stream that is being captured from a microphone or played by any application.

Is it possible to implement the custom audio processing as an Audio Unit which is automatically inserted into any capture or render streams on the machine?

If so, are there any good examples in the public domain that I can take a look at?

This is how I imagine it

user1884325
  • 2,530
  • 1
  • 30
  • 49
  • Yes you can but not necessarily in the same flow you depict. Audio Units are now just app extensions and they will be registered so things like Digital Audio Workstations can load them like plugins. You can tap into the microphone and apply an audio effect, this answer gives a concise way to apply one https://stackoverflow.com/a/65529273/8876321 . This will not affect the input globally, just that one route. The obvious method is to create a virtual audio input device where you apply the AudioUnit to the input then route it. All other apps would take their input from the virtual device. – fdcpp Apr 03 '21 at 12:46
  • See black hole https://github.com/ExistentialAudio/BlackHole or Soundflower https://github.com/mattingalls/Soundflower – fdcpp Apr 03 '21 at 12:47
  • @fdcpp So an Audio Unit itself is not the equivalent of a Windows APO which the OS inserts into audio streams for custom audio processing on the active stream. Correct? – user1884325 Apr 05 '21 at 21:39
  • They are similar in that the Windows APO and AudioUnits are containers for DSP algorithms, but the constraints are very different. – fdcpp Apr 06 '21 at 06:22
  • @fdcpp Right...so it's not like the OS on Mac will automatically run any audio stream through a registered Audio Unit like Windows does with APOs ? – user1884325 Apr 07 '21 at 17:31
  • You can route streams with AVFoundation a la https://stackoverflow.com/a/65529273/8876321 but it won’t be reflected globally. For instance, you could make an app that applies an AudioUnit to the microphone stream and plays it out of the speakers, but that doesn’t mean _every_ app using the microphone will now have processed audio. – fdcpp Apr 07 '21 at 19:38

0 Answers0