Streaming songs to connected devices using gamekit - iphone

I want to play the song from one iphone to the other, it is like the user from device A selects a song from his IPod and plays it, while the users on Device B can also listen to that song using their own iphone which is connected to the Device A using either the Game Kit or wifi.
So is it possible to stream the song from the ipod library to the other devices or not.

This is not possible technically, because you can't get to the audio data -- either as a decoded PCM stream or as the original encoded AAC or MP3 files -- via the MPMusicPlayerController or any other public API. Therefore device A is not in a position to send audio data over the network to device B.
Device B could receive and play streamed audio from the network, of course, since that's what apps like Pandora, Last.fm, and AOL Radio do. But for device A to send the data, it would have to use some source other than its own iPod library.

From the point of view of copyright protection, I don't think this is possible - legally, that is.
It might be possible technically, in that you may be able to send the raw bytes of the song file over wifi or bluetooth and then decode and play them on the second device, but that surely won't get past Apple's reviewers.

Related

Synchronized Audio Streaming over Bluetooth

I am working on an iPhone app that needs to stream audio file to multiple devices (iPhone) connected via Bluetooth and play it in the Synchronized way, that is, all the devices starts playing the audio file simultaneously.
I am able to make a connection and stream the audio packet and even play the audio file, but the only issue that I am facing is the Latency. All the devices starts playing the audio file at different time, I want all of them to play the same audio packet together. Is there any way I can make them play audio file synchronously?
I remember glancing over audio broadcast option in the bluetooth spec. Not sure whether iphone supports it..

iPhone Bluetooth Audio API

My car has bluetooth capabilities for connecting to my iphone for phone calls; however, it does NOT support bluetooth audio for music streaming. I know apps like viber or skype also use bluetooth for phone calls. My question is: is it possible to write an app that fakes phone calls to stream music to my car, as if someone is calling me (but is actually playing music)? Is there some other way to hack this to get bluetooth audio streaming?
No need to jailbreak your phone. Just buy the A2DPblocker app. Costs $2.99. Sound quality isn't perfect but better than the alternative. Worked for my 2010 Volkswagen so should work for any other car that supports bluetooth but not streaming music.
First poster -
There is already an app to do this - it's part of SBSettings called Bluetooth Mono that needs to be installed (so only MONO and only for JB'd phones).
Second poster -
I suspect you are correct about HSP - I've installed the app and the sound quality is terrible.
So, I've put all my music on a USB stick and leave it permanently plugged in. Far superior sound.
Mike
I don't think there's an easy way to do this. But the bigger issue is that it would sound terrible. The bluetooth connections for doing phone calls use headset profile (HSP) and are low bitrate, mono, and frequency limited to voice ranges.
Applications for streaming audio/music over bluetooth use A2DP profile, which is much higher bandwidth and stereo.
If you try to pipe music over a an HSP phone link it will sound horrible, just as it does if you are talking to someone on the phone and they have music playing in the background.

Sharing Audio over bluetooth

I want to write a function in my iPad App, which allows me to stream the music choosen on iPad to the connected Game-Interfaces (iPod, iPhone...) via bluetooth. Does anyone knows a simple solution or maybe wants to share some sample code?
Thanks for help!
I am doing something very similar. I have my iphone connecting to multiple devices to stream audio to them, but I want the device that is streaming the audio to also play audio as well.
You can look into the GKSession in the GameKit API and that should give you a good start.
Also maybe openAl, but I think that might be a little overboard. I heard Core Audio has a built in feature for bluetooth devices that are connected to play audio through them but I dont think this goes for iPhone, iPad, iTouch etc....
I have also created my own peer connection interface that allows me to see multiple bluetooth devices that are running my app. I then can click each one and each gets connected. I then I added a test to push a text message to all connected devices for testing. Next I need to find out how to stream audio to the connected apple devices.
If anyone has any info on this I am sure we would both appreciate it.

Stream a song on an iphoe to another iphone?

Is it possible to write an iphone app that allows a user to pick a song (located on their iphone) and have it play out on an another iphone based on a client-server type relationship over a wifi connection?
Thanks for your help,
Lee
You don't ever get access to song data from the iPod library on the phone. All you can do is get the phone to play the audio. Apple won't allow this as it would violate copyright.

iPhone Music Library Access

I would like to develop an application for iPhone that classifies the user's music according to user-defined genres. The application should be able to have access to iPhone's Music Library and work on the files, this is, fetching an mp3 file, apply some DSP ( like MFCC coefficients ) and then save the results on the file itself.
Is it possible to obtain a song as a file and work on it?
No. You have access to the music library database and can launch a music player to play a certain song but under the SDK you have neither access to the song files themselves nor to the actual PCM data of the music.
Also, access to the music library database on the device is strictly read-only, so you can't modify genres etc. if that was your plan.
I know this is not the answer you are looking for, but given that you can't access the music data from the iPhone, you might consider having a desktop app that accesses the user's music on their Mac/PC, and encodes something into the genre of the music there. Then you could write a music player app for the iPhone that can understand your genre descriptor and function accordingly. You could even go as far as having your iPhone app and desktop app communicate via WiFi to synch up data.