10

I have a conundrum:

I need to find a way to capture the raw audio data that is being piped to the Built-in Output on Mac OS X. Core Audio, HAL, etc.

I can "listen" in on the Built-in Output and the mic, but neither of these appear to offer the correct data stream - the exact stream (all combined data from all input sources) that goes to the speakers/built-in output.

Any advice is welcomed with appreciation.

Demi
  • 6,147
  • 7
  • 36
  • 38

3 Answers3

2

maybe you should have a look at the Jack source code...

http://sourceforge.net/projects/jackosx

kent
  • 6,286
  • 4
  • 27
  • 32
0

Do you need to access to that stream from your program, or do you just want to rip audio from it? In the second case, a quick Google search turned up http://www.ambrosiasw.com/utilities/wiretap/ and http://www.rogueamoeba.com/audiohijackpro/. None of those are open-source or free though.

Edit -- whoops, you want to access to programmatically, that answers my own question, sorry. I think I'll keep my answer here in case some folks stumbles upon this page wanting to record audio non-programmatically.

Etienne Perot
  • 4,764
  • 7
  • 40
  • 50
  • 1
    Wiretap is like what I need to implement - it captures the outgoing stream. I just need some deep insight as to how an application such as wiretap interfaces with either Core Audio and/or the HAL. – Demi May 30 '09 at 05:59
0

You need will need your app to install a system extension. Soundflower is an open-source implementation of such an extension.

Thomas Zoechling
  • 34,177
  • 3
  • 81
  • 112
  • explain further, please. I have seen Soundflower and understand it to be a bridge between differing audio devices. I do not understand how this applies to this particular scenario... – Demi May 30 '09 at 05:57
  • if I understand you correctly, you want to record mixed system audio. With soundflower you could do exactly that. As far as I remember that's how system audio recording works in Rogue Amoebas Audio Hijack Pro. If you select "System Audio" as input source, it asks you if the soundflower system extension should be installed. Of course wo need code that does the actual recording. (As we answered to your SO question here: http://stackoverflow.com/questions/871819/code-sample-for-capturing-audio-from-a-mac-in-cocoa-and-saving-to-file/874855#874855 ) – Thomas Zoechling May 30 '09 at 09:11
  • Here's the thing that bugs me, though. If SoundFlower is installed, it requires a restart. However, when one uses an application such as WireTap, it requires no additional installs - you copy it to the Applications directory and can just run it. What I need to know is the "magic" that permits such an application to get the mixed system audio without additional installations. – Demi Jun 18 '09 at 15:01