Qtkit->Qtmovie set audio device

Discussion in 'Mac Programming' started by dellta, Dec 27, 2010.

  1. dellta macrumors newbie

    Dec 27, 2010
    Hi Guys,

    Sorry for a possible newbie question. I have written a small test audio player using QTKit and QTMovie. However i was wondering how i would set the Audio device on the QTMovie to play it out of different output speakers as i have several different types.

    I have found examples and implemented code that gets a list of audio devices which includes the devices uidstring. However I'm compiling for x86_64 which wont let me use the QTAudioContextRef examples for setting audio context of a QTMovie as QTAudioContextRef seems to be 32-bit only.

    Wanting to use qtkit so i can play my drm protected audio files that i purchased on itunes a long time ago.

    any thoughts?
  2. foidulus macrumors 6502a

    Jan 15, 2007
    I've done something very similar to this and my first suggestion is to not use QTMovie, you are much more constrained in what you can do with QTMovie than you are with what you can do with Core Audio and NSSound. So if possible, ditch QTMovie for those two APIs(it's really easy to change what device you play an NSSound to)

    Here is a great tutorial and sample code that does exactly what you want(I didn't write it, but I did find it immensely useful)

    Let me know if you have any questions.
  3. dellta thread starter macrumors newbie

    Dec 27, 2010
    Many thanks I will take a look at nssound. quick googling around seems to imply that nssound should play my iTunes drm files if my account is added to iTunes. In your implementation, was this something you tested?
  4. foidulus macrumors 6502a

    Jan 15, 2007
    No, we didn't use any DRM files in our environment, but my guess is that ultimately QTKit and NSSound call the exact same libraries so they probably should both work.

    The other option is use the old Quicktime libraries, but that is both a royal pain and ultimately a dead end. Its currently not deprecated, but my guess is in the future it will be. At any rate if you use Quicktime(not QTKit) you won't be able to compile your app in 64-bit.

Share This Page