• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get feed samples to QT in realtime? (like CoreAudio)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get feed samples to QT in realtime? (like CoreAudio)


  • Subject: Re: How to get feed samples to QT in realtime? (like CoreAudio)
  • From: Ethan Funk <email@hidden>
  • Date: Mon, 14 Mar 2005 08:08:04 -0700

I too am using QT with core audio, and I also started with Kurt's code. I have changed it substantially and at this point it only looks like Kurt's code in concept. The changes are all adaptions for my particular application, not code problems (except the previously mentioned play position problem) - Kurt did an excellent job... Thanks Kurt!

The basic idea is to read from a ring buffer in your render-call-back that feed the core audio chain. When the your call back notices that there is enough room in the buffer for doing some more filling, in block sizes that you set, it wakes a filler thread who goes off and gets more samples from QT and decompresses them if needed. The block size will effect how often the filler thread get called to wake up. This keeps all the QT stuff in a separate thread from the core audio calls. Very nice.

Have a look at Kurts code first and if you want to see my adaption let me know.

Ethan...
email@hidden


On Mar 14, 2005, at 7:07, Kevin Boyce wrote:


On Mar 14, 2005, at 2:09 AM, David M.Cotter wrote:

using CoreAudio, I can set up an output, set up an render callback, then start the output. then the output "pulls" samples from the render callback, and from there I have access to the samples. eg: I can use FillComplexBuffer() and whatnot to get the decompressed data from an MP3. lovely. at that point I can massage the data how I see fit before sending it along to CoreAudio.( as long as I do it very very fast)

is there any way to play QuickTime audio this way? eg: is there a QuickTime AudioUnit?

Not so far as I know, but Kurt Revis has written a very nice QT audio player class called QTSoundFilePlayer <http://www.snoize.com/>. I'm using it, and it works very nicely (except that the "current time" reporting; if you need accurate times let me know and I'll send you my mods).


see, I was going with CoreAudio cuz it's new and modern, and because Apple told me to. but it doesn't play AAC (why?), OGG, or LAME MP3's (another why?). But QuickTime does.

Note that nothing other than iTunes is allowed to play protected AAC (boo!), though you can certainly do unprotected AAC with QTSoundFilePlayer.


Oddly, it doesn't work with Ogg either. I'm not sure why, since iTunes, Amadeus, and QT Player all play Ogg files just fine (after installing the Ogg component). But for some reason QTSoundFilePlayer returns a "didn't fill buffer" code at the first call to GetMediaSamples. Apparently the Ogg component is missing certain operations. Or something.

However, all this should be doable with pure CoreAudio, I should think. Maybe the AudioFile API has what you need and I should shut up, but I haven't explored that yet.

-Kevin

-- Kevin Boyce
"Burn the land, and boil the sea; You can't take the sky from me."


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >How to get feed samples to QT in realtime? (like CoreAudio) (From: "David M.Cotter" <email@hidden>)
 >Re: How to get feed samples to QT in realtime? (like CoreAudio) (From: Kevin Boyce <email@hidden>)

  • Prev by Date: Re: How to get feed samples to QT in realtime? (like CoreAudio)
  • Next by Date: Apple CoreMidi
  • Previous by thread: Re: How to get feed samples to QT in realtime? (like CoreAudio)
  • Next by thread: Apple CoreMidi
  • Index(es):
    • Date
    • Thread