iOS output stream music in background - iphone

to cut story short Im developing an app thats like Sonos. That is, Im trying to stream music from the iPod library to a hardware over wifi. Hence the sound will come out of a hardware that is connected to the iPhone by wifi.
Doing this is easy enough when the app is foreground but in the background the app will be terminated. It is different when outputting the audio in the background in the iPhone device itself.
Also I notice that Sonos supports this feature only for iOS 6 so I wonder if theres some new magical API that allows this.
I hope any of you gurus can guide me to the right path.

Related

Multipeer Connectivity audio streaming stop work on background

I'm doing some audio streaming with iOS 7's Multipeer Connectivity framework. The streaming works well, but when I put the app on background it stops working.
Someone can tell me if this is a framework limitation, or I'm doing something wrong?
And, if it is a framework limitation, is it possible to do something to avoid this?
Can I use Background Tasks, to keep streaming and music working on background?
Is possible do this? If is not possible, do any alternatives exist for MultiPeer audio streaming between iOS devices?.
I´m using this example: https://github.com/tonyd256/TDAudioStreamer.
Explained on this page: http://robots.thoughtbot.com/streaming-audio-to-multiple-listeners-via-ios-multipeer-connectivity.
Thanks a lot!
On the Apple documentation for playing audio in the background (scroll down a bit). Some relevant paragraphs:
When the UIBackgroundModes key contains the audio value, the system’s media frameworks automatically prevent the corresponding app from being suspended when it moves to the background. As long as it is playing audio or video content or recording audio content, the app continues to run in the background. However, if recording or playback stops, the system suspends the app.
You can use any of the system audio frameworks to work with background audio content, and the process for using those frameworks is unchanged.
This means that iOS should recognize that you're playing audio through Core Audio, and keep your app unsuspended, as long as you've correctly configured your app for playing audio in the background.
Because your app is not suspended while playing media files, callbacks operate normally while your app is in the background. In your callbacks, though, you should do only the work necessary to provide data for playback. For example, a streaming audio app would need to download the music stream data from its server and push the current audio samples out for playback. Apps should not perform any extraneous tasks that are unrelated to playback.
You should be able to operate normally as long as your app is still playing audio, and is allowed to do what it needs to in order to continue playing audio. This means that you should be able to continue to use MPC in the background to receive the audio data and play it.
Be sure to read the entire documentation on the subject, especially regarding Audio Sessions.
iOS devices get limited cpu cycles for explicit purposes when they have been backgrounded by the user.
According to Apple's documentation on multitasking and execution in the background, the following types of apps are supported, but have to be explicitly declared:
Apps that play audible content to the user while in the background, such as a music player app
Apps that record audio content while in the background.
Apps that keep users informed of their location at all times, such as a navigation app
Apps that support Voice over Internet Protocol (VoIP)
Apps that need to download and process new content regularly
Apps that receive regular updates from external accessories
Your case falls under Apps that play audible content to the user while in the background, such as a music player app. You can find more information from the link provided above.

Record Video of my running application in iPhone

I want to record a video of my application which is running on my iPhone and use it for Replay. How can I do that?
I was searching for this and could't find any solution.
Your only options are:
1. Run the app in the simulator and use any screen capture tool for mac to record a video
2. Fix the iPhone on a pod/stand and record video of you app with another camera
If the app does not have any feature which is available only on the device i would avoid option no 2, because iPhone's glossy screen shows all kinds of reflections and the user's hand in the video is really annoying..
Well, if your phone is a 4S you can get a dongle from Apple that outputs the video as a HD stream. The dongle lets you plug in a HDMI cable, so you would need some way to capture that output.

ShopKick sound detection on iPhone

Is anyone aware of how ShopKick iPhone app is able to continuously record sounds (and process them) while running 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.

Digital picture processing on iPhone

I want to write application on iPhone which will:
make some digital processing on video from iPhone camera (in real time)
send some graphics through TV-Out
Could You tell me if this above is possible on iPhone 3G or 3GS?
Can I have access to each pixel in video capturing via iPhone camera?
There are private access points to do both live video recording and TV out. They are not well documented so you won't find much about them though and you wouldn't be able to submit anything that uses them to the app store. Real time video capture will probably eventually become a public part of the SDK but TV is probably less likely at this point.