views:

394

answers:

1

What I'm trying to do: Record the speaker output using Audio Units.

What I have tried: I'm using Apples sample code "RecordAudioToFile", (http://developer.apple.com/mac/library/samplecode/RecordAudioToFile) which does exactly what I want, except that it use the microphone as input.

It thought changing kAudioHardwarePropertyDefaultInputDevice to kAudioHardwarePropertyDefaultOutputDevice would solve my problem, but with the change, I get no calls to the callback method.

See my code here (line 361 has the change above): *http://www.rdahl.se/misc/DCAudioFileRecorder_modified.cpp*.

HELP NEEDED!

  • What do I have to do to solve my problem?
  • Tips on good guides on audio unit development?

Thanks! :)

+1  A: 

You cannot use an output device (speakers) as an input device.

AFAIK the solution employed by software like Jack OS X is to appear as a fake audio device and redirect a program's output to this pseudo-device.

diciu