• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: No interruption events when pausing music using headphone controller
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: No interruption events when pausing music using headphone controller


  • Subject: Re: No interruption events when pausing music using headphone controller
  • From: Beinan Li <email@hidden>
  • Date: Tue, 28 May 2013 11:27:49 -0400

I further checked the doc about Audio Routes.

It looks like they are in charge of routing to I/O hardware instead of software (apps). For example, output routes include:

const CFStringRef kAudioSessionOutputRoute_LineOut;
const CFStringRef kAudioSessionOutputRoute_Headphones;
const CFStringRef kAudioSessionOutputRoute_BluetoothHFP;
const CFStringRef kAudioSessionOutputRoute_BluetoothA2DP;
const CFStringRef kAudioSessionOutputRoute_BuiltInReceiver;
const CFStringRef kAudioSessionOutputRoute_BuiltInSpeaker;
const CFStringRef kAudioSessionOutputRoute_USBAudio;
const CFStringRef kAudioSessionOutputRoute_HDMI;
const CFStringRef kAudioSessionOutputRoute_AirPlay;
In my scenario, I "imagine" that a possible route change would be audio stream was routed to Music app or my own app. So I fail to see how the routes listed above can account for my scenario.


Beinan 


On Tue, May 28, 2013 at 11:02 AM, Beinan Li <email@hidden> wrote:
Hello Valentin,

I tried to use this property and gave it a listener callback. Unfortunately, in my scenario, my callback wasn't called. I tried to set that property after AudioSessionInitialize(NULL, NULL, interruptListener, myObj), then before or after the AudioSessionSetActive(true) call. Didn't make any difference. 

Am I calling it in the wrong way or order or is it simply saying that my audio route hasn't changed when I pause/resume the background Music playback?

Thanks,
Beinan 


On Mon, May 27, 2013 at 1:21 PM, Valentin Radu <email@hidden> wrote:
Hi Beinan,

Not sure if I get your question right, but if I do, there is 

AudioSessionAddPropertyListener (kAudioSessionProperty_AudioRouteChange,
                                     yourCallback, (__bridge void *)(objectThatCanBeReferencedFromCallback));

that allows you to listen for audio route changes, like the one you described.

Cheers,
Valentin



On 27 May 2013, at 19:13, Beinan Li <email@hidden> wrote:

Hi CoreAudio,

Our iOS app uses AudioSessionCategory_SoloAmbientSound.
And if we follow this procedure, the audio of our app will become silence:
1. Turn on the built-in Music app and play it.
2. Turn on our app and make the app sounds play and observe that the Music app is silenced (as expected).
3. Resume the music app playback using the playback control on the bundled iPhone earplug. Notice that app sounds stopped (as expected).
4. Pause the music app playback using the earplug control. 

Now we notice that our app is silent. Audio doesn't come back as "expected".

I initially suspected that maybe the audio session was hijacked by the Music app. So I tried to reset active session in several delegates applicationWillResignActive and applicationDidBecomeActive. But that didn't work.

Is there a way (e.g., a delegate) to track this kind of interruptions?

Thansk!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)

This email sent to email@hidden

Valentin Radu
cocoaexposed.com
@CocoaExposed



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: No interruption events when pausing music using headphone controller
      • From: Kevin Dixon <email@hidden>
References: 
 >No interruption events when pausing music using headphone controller (From: Beinan Li <email@hidden>)
 >Re: No interruption events when pausing music using headphone controller (From: Valentin Radu <email@hidden>)
 >Re: No interruption events when pausing music using headphone controller (From: Beinan Li <email@hidden>)

  • Prev by Date: Re: No interruption events when pausing music using headphone controller
  • Next by Date: Re: No interruption events when pausing music using headphone controller
  • Previous by thread: Re: No interruption events when pausing music using headphone controller
  • Next by thread: Re: No interruption events when pausing music using headphone controller
  • Index(es):
    • Date
    • Thread