HomeForumsOpenEarsOpenEars listening while app is in background

This topic has 4 voices, contains 13 replies, and was last updated by  Halle 21 days ago.

Viewing 14 posts - 1 through 14 (of 14 total)
Author Posts
Author Posts
February 2, 2012 at 3:41 am #8572

jdkaire

First of all I have to say that OpenEars works amazing. Just by following the tutorial you are able to include it in your app easily and it just works.

I just have one question…Is there a way to have OpenEars still listening while the app is on the background? I mean, when the user switches to another app or presses the home button but doesn’t close mine…

Thanks a lot!

Joe

February 2, 2012 at 9:55 am #8573

Halle

Welcome,

Nope, sorry, this isn’t possible. I haven’t pursued it because I don’t think it’s background behavior that Apple intends to accept. Thanks for being straightforward about it though, since it’s frustrating when people ask for this feature under the guise of asking for a different feature.

February 2, 2012 at 4:15 pm #8574

jdkaire

Halle, thanks for your fast response. I have searched everywhere and couldn’t find the answer. So, that’s why I decided to get directly to the point and ask you. At least now I know for sure.

Thanks again,

Joe

March 26, 2012 at 7:06 pm #9062

hartsteins

Actually…..this IS possible. It depends on what sort of background app you may already have running. It is not possible to keep OpenEars going all on its own, but if your app is one of the 3 apple background apps (voip, audio, or location) then OpenEars will continue as active and listening.

March 26, 2012 at 7:16 pm #9064

Halle

Weird, the last time I tested it as audio type background app it didn’t work. It’s been a few versions though, I can believe it’s changed.

March 26, 2012 at 7:24 pm #9067

hartsteins

I am using OpenEars version 0.913 on iOS 5.0 and it seems to work. I did make some changes to the AudioSessionManager however that might be making this possible specifically kAudioSessionProperty_OverrideCategoryMixWithOthers.

When it goes to background, iOS shows “fancy” red navigation bar as OpenEars keeps recording. I am using for continued iPod control, but an easy test is to fire local notifications on specific word/phrase recognition.

Greg

March 26, 2012 at 7:52 pm #9071

Halle

That’s excellent.

April 3, 2012 at 2:25 pm #9193

jdkaire

Yes, my app is not one of the 3 types that Apple lets run in the background, but I found a way to make the app useful.

thanks guys

April 20, 2012 at 3:31 am #9448

gotok

I have a GPS/TTS (Flite) app that I would like to get working in the background. The app uses Flite to speak GPS values like speed. If I set the “Required background modes” to “App registers for location updates” (i.e. one of the three cases for background operation) then the GPS part of my app continues to work in the background, but Flite does not. Is there any way to get Flite to work in the background?

April 23, 2012 at 11:08 pm #9540

hartsteins

gotok,

Register app in required background modes as “App plays audio” as well

Greg

April 24, 2012 at 1:01 am #9541

gotok

@hartsteins,
Thanks for the reply. I’ve tried that and it seems only one or the other works for my app. If I set GPS as the first item in the array and audio as the second, then GPS will work with the screen locked, but not Flite. However, if audio is in the first position of the array, then Flite works but not GPS. In the GPS method “didUpdateToLocation”, which runs when there is a GPS location update, I compute max speed and also when speed exceeds various thresholds, I use Flite to speak the speed. I can tell if GPS runs under screen lock if top speed gets computed. With GPS first in the array, I get max speed computed with the screen locked, but no Flite speaking. I can also test Flite by pressing a button. When I do this to start Flite speaking, then press the screen lock, if audio is set first in the array, the speaking will continue after the screen is locked. However, if GPS is first in the array, then the speaking will cut off when the screen is locked and continue when unlocked. Any idea why the GPS and audio cases seem to be mutually exclusive for my app?

April 24, 2012 at 3:04 am #9542

gotok

@hartsteins,
Just for fun, I did another test with VOIP at the 3rd position in the array even though it doesn’t apply for my app. I this case, the GPS method runs, but the Flite speech initiated from it does not. However, Flite speech initiated from a button continues even after the screen is locked. I wish that I could find out exactly what happens when the various background modes (audio, location, voip) are set. Do you know of any documentation on this?
Thanks for your help..

April 27, 2012 at 12:05 am #9588

gotok

UPDATE:
After more reading in the IOS Library, I set the audio category for my app to “AVAudioSessionCategoryPlayback” and also set the override switch to allow mixing with other applications. The background modes for both audio and location are set in my plist. Now my app works in background mode and will even continue to work when music is playing in the background as well. So, Flite will indeed run in background mode.

April 27, 2012 at 9:32 am #9589

Halle

Very cool, thanks for describing this in detail.

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.