Streaming to an iPad

Discussion in 'iOS Programming' started by multinode, Nov 10, 2011.

  1. multinode macrumors regular

    Feb 4, 2011
    I have two needs:

    1. We want to stream raw audio to an iPad over Bluetooth.

    2. We want to stream serialized .jpgs to an iPad over Bluetooth.

    In the first case, we don't want any iPad codec to process our audio ... we simply want the iPad app which we will write to receive our audio and pass it to the built-in speakers.

    In the second case, we want the iPad app that we will write, to deserialize our .jpg and pass it to the iPad screen. We do want our iPad app to be able to control the size of the .jpg being displayed.

    So there are two fundamental questions

    1. We need an iPad api to extract the payload from incoming Bluetooth packets so that our iPad app can decide if it's audio or .jpg,

    2. We need an iPad api to route our raw audio to the iPad speakers or route our .jpg data to the iPad screen.

    Please help ... we need a starting point. Thanks.
  2. jiminaus macrumors 65816


    Dec 16, 2010
    So you'd be wanting to send raw, uncompressed wave data over bluetooth? Have you calculated the bitrate needed and do you know if bluetooth has the bandwidth to handle that?
  3. amorya macrumors 6502

    Jun 17, 2007
    What is on the other end of the bluetooth connection? (That is, what is sending the audio?)

    1. Another iOS device running the same app
    2. A Bluetooth device created and licensed for the Made for iPod program
    3. A Bluetooth audio device like a headset
    4. A Bluetooth 4.0 Low Energy device
    5. Any other Bluetooth device

    The thing you want to do will be different depending on your answer here:

    1. Use GameKit. You can then pass Objective-C objects over the link, serialised into NSData, so you can just unserialise them and work out what class they are to see what you're being sent.

    2. Use the External Accessory framework. You'll get more information through the Made for iPod licensing program.

    3. Use Core Audio. It should automatically get audio input from a Bluetooth device if one is paired with the iOS device and active. Of course, this will only work for audio and not JPEGs. Your codec will be dictated for you here too.

    4.Use the Core Bluetooth framework in iOS 5. (Note that this only works with the iPhone 4S.) This is the only way of making a custom Bluetooth device that isn't of a class of device iOS already supports and that doesn't involve going through the (expensive) Made for iPod licensing.

    5. This isn't possible.
  4. multinode, Nov 11, 2011
    Last edited: Nov 12, 2011

    multinode thread starter macrumors regular

    Feb 4, 2011
    We are sending voice signals so the data rate could be approximately 8 KB/sec. I understand that the bandwidth of Bluetooth's SCO packets is 64 Kb/sec ... is that correct?
  5. multinode, Nov 12, 2011
    Last edited: Nov 13, 2011

    multinode thread starter macrumors regular

    Feb 4, 2011
    Our device is an audio source that feeds a Bluetooth module. I assume that if our Bluetooth module includes a profile that is supported by iPad, then the iPad will be able to connect to us. Then our device will send SCO Bluetooth packets to the iPad. I think we need to write an iPad app to grab the payload from each of those packets and send the audio data to the iPad speakers.

    There are really two issues here ...
    1. We need an iPad api to parse the incoming Bluetooth packets and an api to route the raw audio data (no codec needed) to the speakers.
    2. What limitations has Apple put on iPad Bluetooth communication ... e.g. are there license fees involved?

    From the description of what we're doing matches your #3 above. So, can Core Audio handle raw audio??
  6. amorya macrumors 6502

    Jun 17, 2007
    I haven't actually done any bluetooth audio development, so do double check anything I post.

    I believe your best bet is to use Advanced Audio Distribution Profile (A2DP). iOS doesn't support many Bluetooth profiles: a list is here.

    To get Core Audio taking input from Bluetooth, look at the code sample here.

    Core Audio is not easy. Take a look at this blog post for a bit about how the different pieces fit together.
  7. amorya macrumors 6502

    Jun 17, 2007
    Core Audio can handle almost anything. How easily it handles it is another matter!

    The canonical format in iOS is apparently Linear PCM with 16-bit integer samples (found here). I think that you'll probably receive audio input in that format.

    If you're just using audio, you're in luck: there are no license fees needed. The limitations here are the user has to handle the pairing outside your app, and the app can't tell if it's your device that's connected or just another random Bluetooth headset (I believe —*I may be wrong on this one). You won't be able to get any details of the bluetooth connection itself; after you've hinted to Core Audio that you want to accept input from a Bluetooth audio device, it'll treat the device just like it was a microphone directly attached to the iPad.

    If you wanted to communicate with a Bluetooth device directly, via a custom protocol, you'd need to join the Made for iPod program, which costs a lot, and Apple won't even consider you unless you're an established business with sufficient turnover. Contact them for more details if you go down that route.

    As I mentioned above, the other way you could go is a Bluetooth 4 Low Energy device. While at the moment it works with the iPhone 4S only (and not with iPad or iPad 2), it'll probably work with future iPads. With the Low Energy devices, you can talk directly to a Bluetooth device, and without the need for Apple's approval.
  8. multinode thread starter macrumors regular

    Feb 4, 2011
    Streaming over Bluetooth to an iPad ... Apple restrictions

    We have an audio device which supports the A2DP Bluetooth profile. We want it to STREAM its audio to the Bluetooth module in our customer's iPad. Several questions:

    1. We've been told that streaming audio into an iPad doesn't require any special license from Apple ... yes or no?
    2. The iPad that we are writing to receive the audio stream and pass it on to the iPad speakers will need to be distributed to our customer from the App Store. Since this a private (our customer only) free distribution, must we disclose its functionality to Apple?
    3.Can we password restrict the use of our iPad app so that only our customer can use it?
    4. Can we feed 8KH, 8b (or 16b), straight PCM to our audio source or must it be A-Law?
    5. Are there any other requirements that our audio source must honor?
    6. Regarding any other restrictions, where inside of Apple can we inquire?

Share This Page