OALAudioSession Class Reference
| Inherits from | NSObject |
| Conforms to | AVAudioSessionDelegate OALSuspendManager |
| Declared in | OALAudioSession.h |
Tasks
-
audioSessionCategoryThe current audio session category. If this value is explicitly set, the other session properties “allowIpod”, “useHardwareIfAvailable”, “honorSilentSwitch”, and “ipodDucking” may be modified to remain compatible with the category.
property -
allowIpodIf YES, allow ipod music to continue playing (NOT SUPPORTED ON THE SIMULATOR). Note: If this is enabled, and another app is playing music, background audio playback will use the SOFTWARE codecs, NOT hardware.
property -
ipodDuckingIf YES, ipod music will duck (lower in volume) when the audio session activates.
property -
useHardwareIfAvailableDetermines what to do if no other application is playing audio and allowIpod = YES (NOT SUPPORTED ON THE SIMULATOR).
property -
honorSilentSwitchIf true, mute when backgrounded, screen locked, or the ringer switch is turned off (NOT SUPPORTED ON THE SIMULATOR).
property -
handleInterruptionsIf true, automatically handle interruptions.
property -
audioSessionDelegateDelegate that will receive all audio session events.
property -
ipodPlayingIf true, another application (usually iPod) is playing music.
property -
audioSessionActiveIf true, the audio session is active
property -
hardwareVolumeGet the device’s final hardware output volume, as controlled by the volume button on the side of the device.
property -
hardwareMutedCheck if the hardware mute switch is on (not supported on the simulator). Note: If headphones are plugged in, hardwareMuted will always return FALSE regardless of the switch state.
property -
audioRouteCheck what hardware route the audio is taking, such as “Speaker” or “Headphone” (not supported on the simulator).
property -
– forceEndInterruptionForce an interrupt end. This can be useful in cases where a buggy OS fails to end an interrupt.
Properties
allowIpod
If YES, allow ipod music to continue playing (NOT SUPPORTED ON THE SIMULATOR).
Note: If this is enabled, and another app is playing music, background audio
playback will use the SOFTWARE codecs, NOT hardware.
@property (readwrite, assign) bool allowIpodDiscussion
If allowIpod = NO, the application will ALWAYS use hardware decoding.
See Also
@property useHardwareIfAvailable
Default value: YES
Declared In
OALAudioSession.haudioRoute
Check what hardware route the audio is taking, such as “Speaker” or “Headphone” (not supported on the simulator).
@property (readonly) NSString *audioRouteDeclared In
OALAudioSession.haudioSessionActive
If true, the audio session is active
@property (readwrite, assign) bool audioSessionActiveDeclared In
OALAudioSession.haudioSessionCategory
The current audio session category. If this value is explicitly set, the other session properties “allowIpod”, “useHardwareIfAvailable”, “honorSilentSwitch”, and “ipodDucking” may be modified to remain compatible with the category.
@property (readwrite, retain) NSString *audioSessionCategoryDeclared In
OALAudioSession.haudioSessionDelegate
Delegate that will receive all audio session events.
@property (nonatomic, readwrite, assign) id<AVAudioSessionDelegate> audioSessionDelegateDeclared In
OALAudioSession.hhandleInterruptions
If true, automatically handle interruptions.
@property (nonatomic, readwrite, assign) bool handleInterruptionsDiscussion
Default value: YES
Declared In
OALAudioSession.hhardwareMuted
Check if the hardware mute switch is on (not supported on the simulator). Note: If headphones are plugged in, hardwareMuted will always return FALSE regardless of the switch state.
@property (readonly) bool hardwareMutedDeclared In
OALAudioSession.hhardwareVolume
Get the device’s final hardware output volume, as controlled by the volume button on the side of the device.
@property (readonly) float hardwareVolumeDeclared In
OALAudioSession.hhonorSilentSwitch
If true, mute when backgrounded, screen locked, or the ringer switch is
turned off (NOT SUPPORTED ON THE SIMULATOR).
@property (readwrite, assign) bool honorSilentSwitchDiscussion
Default value: YES
Declared In
OALAudioSession.hipodDucking
If YES, ipod music will duck (lower in volume) when the audio session activates.
@property (readwrite, assign) bool ipodDuckingDiscussion
Default value: NO
Declared In
OALAudioSession.hipodPlaying
If true, another application (usually iPod) is playing music.
@property (readonly) bool ipodPlayingDeclared In
OALAudioSession.huseHardwareIfAvailable
Determines what to do if no other application is playing audio and allowIpod = YES
(NOT SUPPORTED ON THE SIMULATOR).
@property (readwrite, assign) bool useHardwareIfAvailableDiscussion
If NO, the application will ALWAYS use software decoding. The advantage to this is that
the user can background your application and then start audio playing from another
application. If useHardwareIfAvailable = YES, the user won’t be able to do this.
If this is set to YES, the application will use hardware decoding if no other application
is currently playing audio. However, no other application will be able to start playing
audio if it wasn’t playing already.
Note: This switch has no effect if allowIpod = NO.
See Also
Default value: YES
Declared In
OALAudioSession.h