• 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: When do you ever call AudioSessionSetActive(false)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When do you ever call AudioSessionSetActive(false)?


  • Subject: Re: When do you ever call AudioSessionSetActive(false)?
  • From: Douglas Scott <email@hidden>
  • Date: Thu, 11 Jul 2013 08:58:18 -0700

While your audio session is active, you usually are in control of the audio route (which hardware is recording and which is playing back) plus the sampling rate for the audio, etc.  Your app may only use audio at certain times, and go long periods of time not using audio.  During those times, "polite" apps would set their audio session to inactive to stop interacting with the audio system when they did not need to.  This is not essential, as you can tell -- other apps which start up later and activate their audio sessions will, under most circumstances, either mix with the audio from your app or interrupt your app's audio session.  At that point your audio session will have been automatically set to inactive, and you will have to reactivate when your app is once again in the foreground (and needs to play and/or record audio).

-DS

On Jul 11, 2013, at 8:20 AM, Beinan Li wrote:

I just found that my AudioSessionSetActive(false) call in my "shutdown" code never returns noErr. There are some undocumented code like (OSStatus) 803204036, which corresponds to none of the listed return codes:
http://developer.apple.com/library/ios/#documentation/AudioToolbox/Reference/AudioSessionServicesReference/Reference/reference.html

And I went through all listed Xcode sample codes that are relevant to AudioSessionSetActive() and found absolutely no calls with "false" argument. 
All the samples just call AudioSessionSetActive(true) under various scenarios.

Is that we are not supposed to call AudioSessionSetActive() with false ourselves?
Is it that the deactivation is handled implicitly?

Beinan


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
References: 
 >When do you ever call AudioSessionSetActive(false)? (From: Beinan Li <email@hidden>)

  • Prev by Date: Re: Lion/XCode4 AU tutorial [slight emergency]
  • Next by Date: Re: When do you ever call AudioSessionSetActive(false)?
  • Previous by thread: When do you ever call AudioSessionSetActive(false)?
  • Next by thread: Re: When do you ever call AudioSessionSetActive(false)?
  • Index(es):
    • Date
    • Thread