Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Transmitting iOS library music to multiple iOS devices

Tags:

ios

iphone

ipad

I would like to grab an audio file from the iOS device's iTunes library, then transmit it via bluetooth to another iOS device. At that point, the audio would be playing from device #1 and device #2 at the same time. Is this possible? If so, where can I go to learn about how to do this? If it is possible, can I do it using GameCenter or Airplay?

like image 735
spentak Avatar asked Nov 25 '25 14:11

spentak


2 Answers

No this is entirely possible, the eavesdrop app does it.

What you'll probably need to do to get the songs is use the Media Player framework to get access to the songs you want (probably with a picker view), and then bring them into the AVFoundation framework as AVAssets. This can be done by using the MPMediaItemPropertyAssetURL key from an MPMediaItem and +[AVAsset assetWithURL:]. From there you'll have to check the exportable flag on the AVAsset, and if it is true you can use an AVAssetExportSession to get it into your app's directory. Not entirely knowing what you plan to do you might actually be able to stop at the AVAsset and somehow work from there.

As a note, I haven't ever done any of this so don't get to mad if it doesn't work, but this is my understanding of it. Hope it helps!

like image 61
axiixc Avatar answered Nov 27 '25 05:11

axiixc


You can send almost everything you want through the GameKit Framework. But you can't access the files in your iPod Library, this means you can't send iPod-Songs through the GameKit Framework.

like image 20
Fabio Poloni Avatar answered Nov 27 '25 03:11

Fabio Poloni



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!