Ok, so here it goes. For the past couple of days I've been struggling with this issue immensely. Basically, what I've done is I have created an audio driver for macOS that successfully routes audio to a virtual speaker (I used the sample code from Apple: Creating an Audio Server Driver Plug-In + looked at other apps that do the same thing).
Now, I'd like to add an additional "step" to this driver, adding a machine learning component that will do something with the incoming audio stream. I explored the options, and saw that the perfect candidate for the job will be the TensorFlow Lite framework (specifically its C API). After adding the framework to my Xcode project (which was a challenge in and of itself, but I managed to compile everything successfully), I am struggling with a different issue, and that is, after I link the dynamic TF library in my project (adding the libtensorflowlite_c.dylib to "Link Binary With Libraries") the driver becomes invisible in the sound preferences panel. Once I remove the libtensorflowlite_c.dylib from the Build Phases and recompile everything, it shows up with no problem, and I can route everything through it. This leads me to two questions:
Is putting the ML component in the file that sets the driver even a correct strategy?
And if it is a correct approach, how can I compile the driver with the TFLite library so that it shows up in the sound preferences?
Here's a small breakdown of the things that I tried, but was unsuccessful:
- Add the
entitlements.plistfile to the project with "Disable Library Validation" flag set to YES (without it, I get this errornot valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?))) - Embedded and signed the
libtensorflowlite_c.dylibin my project + linked the Runpath and Library search paths to the library within the scope of the project, not theusr/local/libpath.
What I am basically trying to achieve, is something like the Utterly app (Link to the app: Utterly), which also routes the audio to a virtual speaker/microphone and has that additional layer of noise reduction on top of it. Playing around with the app made me wonder if the AI component is embedded within the driver, or rather outside, since the app is visible both in the tab bar and activity monitor on Mac.


