Inter-app Audio

82 views
Skip to first unread message

Nguyen Minh Tien

unread,
Feb 10, 2014, 1:29:20 AM2/10/14
to open-music-app...@googlegroups.com
Hello OMAC-group !
I am a developer of ifretless apps. Our apps support background audio for Midi. I have a problem with the new feature of ios 7 : Inter-app audio (IAA). When i implement IAA on ifretless app, I have to stop the Audio session before i can connect to the host. It means i have to stop the background audio, so it causes the midi problem. Does anyone have the same problem ? Your help will be greatly appreciated. Thank you !

David Blake

unread,
Feb 10, 2014, 1:34:48 AM2/10/14
to open-music-app...@googlegroups.com
Hi Nguyen,

Theres an IAA group that I find often has some helpful advice:

As for your problem, not sure I understand. You basically want to keep a loop in an iFretless app repeating and also connect it as a node? But you have to stop the audio session for the iFretless app because you're disconnecting the remoteIO unit from the speaker and connecting it to the host app, correct?

David

Jesse Chappell

unread,
Feb 10, 2014, 1:37:21 AM2/10/14
to open-music-app...@googlegroups.com
I never had to stop the audio session when the IAA host connected...
what makes you think you do?

jlc
> --
> You received this message because you are subscribed to the Google Groups
> "Open Music App Collaboration" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to open-music-app-colla...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Nguyen Minh Tien

unread,
Feb 10, 2014, 11:24:16 PM2/10/14
to open-music-app...@googlegroups.com
Hi David !
 Yes, it's correct. I tried to keep the audio session running while connecting to the host app, but ifretless starts making no sound, It works fine when i stop the  audio session before connecting to the host. Is there any way to do it without stopping the audio session ?

Nguyen Minh Tien

unread,
Feb 10, 2014, 11:35:53 PM2/10/14
to open-music-app...@googlegroups.com, je...@essej.net
Hi Jesse !
I tried to keep the audio session running when connecting to the host, but when i did that, my render callback was not looping anymore. (I used that function to process my audio samples). Do you know the way to deal with it ? Thank you !

David Blake

unread,
Feb 10, 2014, 11:53:51 PM2/10/14
to open-music-app...@googlegroups.com
Hi Nguyen,

I think you may have just helped me solve a problem that has been plaguing me for weeks with my own IAA node connecting. I noticed that sometimes when I connect my app as a node it doesn't make any sound, sometimes it does. I thought it was having problems doing both host and node at the same time (as a host background audio is enabled), but I just did a test with Background audio on and off and replicated the problem. I'll have to do some more testing (in the middle of something else right now) but looks like I could be experiencing the same problem as you are. Can you not just disable the audio session, connect the node, and reactivate the audio session? Or is there a noticeable pause that you don't like?

Nguyen Minh Tien

unread,
Feb 11, 2014, 12:03:38 AM2/11/14
to open-music-app...@googlegroups.com
Hi David !
Actually i solved that problem by de-activate the audio session before connecting to the host & reactivate the audio session when the host connected. By doing that, i have to stop the background audio, which uses for the midi. So, i try to figure out other solution so that both of them can work together.

Jesse Chappell

unread,
Feb 11, 2014, 5:36:28 PM2/11/14
to open-music-app...@googlegroups.com
Actually, I was mistaken. When I receive the InterAppConnected
property change notification I do in fact stop the session, then start
it again immediately. But everything seems fine after that on my end.

The only other potential trick I use, is a test in my audio engine start
code path (before the actual session activate call) similar to the following:

====
UIApplicationState appstate = [UIApplication
sharedApplication].applicationState;
bool inForeground = (appstate != UIApplicationStateBackground);

if (!inForeground && !mInterAppConnected) {
// Start called in background, maybe need to wait for inter app
audio connection
return;
}
=====

This could occur only when the app was started in the background by an
IAA host and we haven't received the connected notification, and
defers actual starting of the audio session until we receive the
InterAppAudioConnected property change notification (at which time
we'll start the session).

jlc
>> > email to open-music-app-colla...@googlegroups.com.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Open Music App Collaboration" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to open-music-app-colla...@googlegroups.com.

Nguyen Minh Tien

unread,
Feb 12, 2014, 1:27:33 AM2/12/14
to open-music-app...@googlegroups.com, je...@essej.net
Hi Jesse !
I figured out it yesterday. You make me think when you said you do not have to stop the audio session when the host connected. So, i look at the code again then find out i can stop the audio session in the InterAppConnected property change notification  function. Thank you so much !
>> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Open Music App Collaboration" group.
> To unsubscribe from this group and stop receiving emails from it, send an
Reply all
Reply to author
Forward
0 new messages