2

I have a simple audio playing app that uses QTMovie for a few of it's features. I'm also developing a little ethernet-enabled board to stream MP3 or PCM data to.

Is there any way of 'grabbing' what QTMovie is outputting, format it into an array of bytes and send it over ethernet to a specific IP? Somehow iTunes manages to do this with AirPlay, so there's some sort of way to do this.

Thanks for any answers!

Tristan
  • 3,058
  • 6
  • 40
  • 68

1 Answers1

1

There are off-the-shelf products like Rogue Ameoba's airfoil that you might want to look at:

http://www.rogueamoeba.com/airfoil/mac/

But if you really want to get your hands dirty and develop something yourself, it looks like QTMovie just outputs to Core Audio, and you can set which device:

http://developer.apple.com/library/mac/#qa/qa1578/_index.html

There's a bit of Q&A on the topic of how programs that intercept Core Audio devices do that:

Code sample for capturing audio from a Mac in Cocoa and saving to file?

Community
  • 1
  • 1
  • Note that the APIs in QA1578 require you to use the old Quicktime Framework. If you're using QTKit only (e.g. on 64-bit Mac OS X) you can't go that route. – Jonathan Grynspan Oct 12 '11 at 04:55
  • So to get this data in my app on Mac OS X 10.7, I would need to compile my app as 32-bit only, or will it just not work whatsoever? – Tristan Oct 13 '11 at 02:12
  • Jonathan's note seems to be specifically about the API tech note for telling QTMovie which of the system audio devices to output to (which could in theory be your own custom driver). While programs like Logic have it as a matter of necessity, it looks like iTunes etc. lack this for some (dumb) reason. In any case, the rest of the answer would apply if you are happy to swipe the mixed down audio output of all applications on the machine, of which QTMovie might not be the only component. – HostileFork says dont trust SE Oct 13 '11 at 03:56
  • I wonder how iTunes does manage to do this then. I'm assuming that to do this, I'd need to somehow 'hook into' QuickTime's sound output before it reaches the driver and intercept it, or just roll my own audio decoder, which would probably be easiest. I might tool around with CoreAudio to see what it has to offer in the sound playing department and how I could get the raw sample data from there. – Tristan Oct 13 '11 at 04:03