views:

270

answers:

1

I am trying to build what I think is a basic app. Well, two apps one for windows and one for OS X. I would like to capture the audio signal that is playing (ie if the user is playing music out his/her speakers). Then take that signal and stream it out so another computer can "listen". The other computer would be Windows or OS X.

  1. Any ideas on how to get the audio signal?
  2. What's the most efficient way to stream out audio without a 3rd party plugin? If there is an open-source solution out there, I would be interested.

Thanks!

Chris

+2  A: 

On Windows XP this isn't trivial at all because there's no way of intercepting the output signal without writing an audio filter driver (which is not somethign for the faint of heart).

On Windows Vista and above, you can capture the output of the audio engine by using the WASAPI APIs (built into Windows so they're free) and initializing an audio client with the AUDCLNT_STREAMFLAGS_LOOPBACK flag. This will give you a capture stream that's hooked to the output of the audio engine.

You can then package up that audio and send it to the other machine and render it with whatever audio rendering API you want.

I don't know how to do the equivilant on OSX though :(.

Larry Osterman
Cool. I am ok with requiring Vista. Do you know if this is still available in Windows 7?
ChrisH
Of course it is.
Larry Osterman
It looks like the WASAP API's require a DRM free source. Makes sense but was hoping to be able to stream DRM protected files since this is not meant as a broadcast to many, just to yourself on another device.
ChrisH
If you want to circunvent Audio DRM, you could shortcut your hardware output to your hardware audio input and broadcast that. Otherwise, use a system that is not DRM laden :)
voyager
voyager: Of course if you use a system that is not DRM laden then you can't play back the DRM'ed content.ChrisH: You should be able to loopback DRMed content - the sample quality will be degraded in the loopback but it should still work.
Larry Osterman