Virtual Sound Device under 10.9

I need to be able to capture sound from an application and send it over to another application. It looks like Apple keeps tweaking the sound libraries and finally under 10.9 both Soundflower and Jack stopped working. I started looking for sample code and it feels like Apple is deprecating making kext-based audio drivers — the corresponding sample code is gone from the developer.apple.com site.

However! There is a new code sample AudioDriverExample that worked for me. Check out the SimpleAudio part of the project. It provides a driver that reads data into one buffer and writes data out from another buffer. Replace the input buffer pointer with the output buffer pointer and you get yourself a decent virtual audio driver similar to Soundflower.

You may have to fix a bug in SA_Device.cpp in SA_Device::Stream_SetPropertyData:


ThrowIf(theNewFormat->mFormatFlags != (kAudioFormatFlagIsFloat | kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked), CAException(kAudioDeviceUnsupportedFormatError), "SA_Device::Stream_SetPropertyData: unsupported format flags for kAudioStreamPropertyPhysicalFormat");

replace kAudioFormatFlagIsFloat with kAudioFormatFlagIsSignedInteger.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: