I want to create a virtual audio device that gets audio data from the default output (which is an output IOAudioStream) and converts it to an input IOAudioStream.
I went through most of the examples I could find, however they only implement a feature to copy the output IOAudioStream to the input one at most. That means it only converts the audio to an input stream if the audio device is selected as output.
Some other things to note is that in VirtualBox for Mac OS X, the audio is disabled by default. To enable the audio, select Settings (the OpenSolaris virtual machine must be powered down) and then Audio.
This should be possible, since ScreenFlow allows recording of computer audio by installing a kext that creates a virtual driver.
How can I access the audio data from the default output and send it to my virtual driver?
UpL1nKUpL1nK2 Answers
Take a look at the open-source WavTap, which is a simplified fork of the open-source SoundFlower virtual sound card driver. It is a .kext that I believe does substantially what you want.
For reference, here is how some popular commercial closed-source options work:
Rogue Amoeba's Audio Hijack Pro
-Captures system audio via code based off of the open-source SoundFlower .kext
-Captures an application's audio by substituting a 'patch' framework for the normal CoreAudio.framework when launching the application
-Captures an already-running application's audio with the help of the haxie 'Application Enhancer' (APE) from Unsanity
These features are branded as their 'Instant On' feature (InstantOn.kext).
Ambrosia Software's WireTap Studio
-Captures system audio and application audio via an in-house developed .kext
Telestream's ScreenFlow
-Captures system audio via an in-house developed .kext. (Version 2.x uses varaudio.kext; Version 3.x uses TelestreamAudio.kext)
Macsome's Audio Recorder
-Unknown method
Araelium Group's Screenflick
-Captures system audio using the SoundFlower .kext
UPDATE #1
After reading the author's comments, it appears the underlying goal is to be able to capture the system sound without publishing the virtual audio driver as a device (that would appear in the System Preference's list) and without changing the current default output device (or at least the appearance that the device has changed).
SoundFlower: Adds a sound device to the list upon installation
WavTap: Adds a sound device to the list upon installation; auto-selects the device when the WavTap application is started; auto-deselects the device when the application is shutdown and reselects the previous device
Audio Hijack Pro: Adds a sound device only when audio capture of the default system sound is selected; removes the sound device when audio capture is no longer selected and reselects the previous device
WireTap Studio: Unknown
ScreenFlow: Captures the system sound without changing the current default output device and without publishing the virtual audio driver as a device
UPDATE #2
A quote from Jeff Moore, a CoreAudio Apple engineer, in reference to applications such as WireTap and Audio Hijack Pro:
'There are no APIs on the system that will give you the output of any specific app or the whole mix going to the hardware...[Capturing System Sound] isn't supported by the System and those folks had to be clever. There's nothing stopping you from doing the same thing except how willing you are to get your hands dirty.The fact is, Mac OS X's audio system was designed first and foremost for performance. This lead us to a design where it is not easy to support the functionality you want without imposing performance penalties. So, we have opted for better performance at the cost of not being able to provide this feature.'
If you want to read more on the subject, check out these threads on the CoreAudio API mailing list:
'WireTap, CoreAudio's API, and system capture, and kexts...'
'Another question on capturing audio played back by a software'
'Capturing currently played audio using CoreAudio on Mac'
'audio hijack'
'monitoring system audio output like wire tap'
'Capturing audio output to a file'
'Mirroring Audio Output'
'Recording system audio'
Relevant SO Questions:
Hide Audio device using codeless kext
So long story short, you're not likely to find examples from Apple that accomplish this, and you're not likely to find open source code that accomplishes this either, unless someone is feeling very generous. It appears to be too valuable of information.
After additional research, here are some theoretical techniques I came up with that might allow you to accomplish your goal:
Similar to Prosoft Engineering's Hear product, you could create a HAL plugin (user-mode virtual driver) rather than a .kext (kernel-mode virtual driver). Apple has a sample HAL plugin called 'SampleHardwarePlugIn' and PulseAudio has one as well. However, with his method I don't think you get access to a pre-mixed system sound stream. You would have to gather up all streams from the various applications (which must use CoreAudio to play sound) and mix them together for pseudo system sound capture.
Create a virtual audio device that is hidden [1][2] from user interaction. When the user wishes to capture the default sound, programmatically create an aggregate device that includes your hidden virtual device and the current default sound device. Temporarily set this aggregate device as the default output. In this manner, you are able to both capture the default sound and hear it.
Side Note: If Mac OS X allows for a hidden device to also be set as the default output device, what would System Preferences show as the selected device? If it instead shows the secondary output device as selected, then you have the added allusion that nothing has changed.
protected by Community♦Aug 13 '18 at 15:05
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Not the answer you're looking for? Browse other questions tagged macosaudiokerneldriver or ask your own question.
Virtual Audio Driver For Mac
So I have just realized, that my Traktor Audio 6
would use EVERY and ANY input labeled device as an input...well, duh, how could I think it'd only use the MAIN in's and out's.
But now I have the problem that, when I am live DJing, people can hear the beep-noise from my Timecode Vinyls...which is annoying.
So my question would be, is it possible to create a virtual audio device in Mac OS, by combining the in's and out's - especially the in's of another device?
Like...
That'd be super helpful so I dont have to play around with mixer volumes and alike. :)
ᔕᖺᘎᕊ1 Answer
Free Virtual Audio Driver
I'm not overly familiar with the sort of application you're describing, but you can create “Aggregate Devices” using Audio MIDI Setup, which sounds like it might be helpful.
Camsuite Virtual Audio Driver For Macbook Pro
- Open
- Click the + button and select “Create Aggregate Device”.
- Use the right side panel to choose which existing inputs you want to aggregate.
I've never used this feature, so I have no idea whether it does what you want. If it's completely irrelevant, let me know and I'll delete this answer.
No Virtual Audio Driver
(Also, you might be interested to know that there is a Stack Exchange site specifically for Audio-Video Production.)
Comments are closed.