QT & NSData

  • Hi all,

    An app I'm working on needs to be able to play music
    in the background. These files (mp3) are just stored
    as part of the bundle's /Resources folder, and are
    played simply like this:

    QTMovie* music = [QTMovie movieWithFile: musicPath
    error:NULL];

    However, due to the licensing requirements of the
    music in question, I would prefer not to simply bundle
    up the mp3s inside the app, and would prefer to
    obfuscate them a bit more. (I know, I know, but the
    music is perfect for the app, so I'm willing to at
    least experiment.)

    To that end, I was thinking of how I might use an
    NSData (or even QTDataReference) to hold the 5 or so
    songs and then get QTMovie to play them as a playlist.

    Is this possible? I thought of using NSSound instead,
    with a reasonably intelligent delegate, but the docs
    don't say it'll play mp3s.

    Thanks!

    B


    ____________________________________________________________________________________
    Yahoo! oneSearch: Finally, mobile search
    that gives answers, not web links.
    http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
  • On Oct 6, 2007, at 6:21 AM, Brad Peterson wrote:

    > Hi all,
    >
    > An app I'm working on needs to be able to play music
    > in the background. These files (mp3) are just stored
    > as part of the bundle's /Resources folder, and are
    > played simply like this:
    >
    > QTMovie*    music = [QTMovie movieWithFile: musicPath
    > error:NULL];
    >
    > However, due to the licensing requirements of the
    > music in question, I would prefer not to simply bundle
    > up the mp3s inside the app, and would prefer to
    > obfuscate them a bit more. (I know, I know, but the
    > music is perfect for the app, so I'm willing to at
    > least experiment.)
    >
    > To that end, I was thinking of how I might use an
    > NSData (or even QTDataReference) to hold the 5 or so
    > songs and then get QTMovie to play them as a playlist.
    >
    >
    > Is this possible? I thought of using NSSound instead,
    > with a reasonably intelligent delegate, but the docs
    > don't say it'll play mp3s.

    You could look into encrypting the resource files.  I do this for all
    my PDF artwork.  In my image factory class, image file data are
    wrapped in NSData.  I then decrypt it and pass it onto the relevant
    API for loading/drawing.

    ___________________________________________________________
    Ricky A. Sharp        mailto:<rsharp...>
    Instant Interactive(tm)  http://www.instantinteractive.com
  • Brad Peterson wrote:

    > Hi all,
    >
    > An app I'm working on needs to be able to play music
    > in the background. These files (mp3) are just stored
    > as part of the bundle's /Resources folder, and are
    > played simply like this:
    > ...
    > However, due to the licensing requirements of the
    > music in question, I would prefer not to simply bundle
    > up the mp3s inside the app, and would prefer to
    > obfuscate them a bit more. (I know, I know, but the
    > music is perfect for the app, so I'm willing to at
    > least experiment.)
    > ...
    > I thought of using NSSound instead, with a reasonably intelligent
    > delegate,
    > but the docs don't say it'll play mp3s.

    The docs are in need of some overhaul and consolidation. NSSound will
    play any audio format QuickTime can.
    <http://developer.apple.com/qa/qa2001/qa1335.html>

    Have you actually checked the licensing to see if it really is so
    excessive that you're willing to risk crippling penalties if you're
    caught? (I mean, by posting you've created an indelible record of
    intent and all.)
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today