Handles the audio session and interrupts. More...
#import <OALAudioSession.h>
Instance Methods | |
(void) | - forceEndInterruption |
Force an interrupt end. More... | |
Instance Methods inherited from <OALSuspendManager> | |
(void) | - addSuspendListener: |
Add a listener that will receive manual suspend and interrupt events. More... | |
(void) | - removeSuspendListener: |
Remove a registered listener. More... | |
Protected Member Functions | |
() | - SYNTHESIZE_SINGLETON_FOR_CLASS_HEADER |
Singleton implementation providing "sharedInstance" and "purgeSharedInstance" methods. More... | |
Protected Attributes | |
bool | handlingErrorNotification |
Flag signifying that we are currently handling an error notification. More... | |
bool | audioSessionWasActive |
If true, the audio session was active when the interrupt occurred. More... | |
OALSuspendHandler * | suspendHandler |
Handles suspending and interrupting for this object. More... | |
NSDate * | lastResetTime |
Marks the last time the audio session was reset due to error. More... | |
Properties | |
NSString * | audioSessionCategory |
The current audio session category. More... | |
bool | allowIpod |
If YES, allow ipod music to continue playing (NOT SUPPORTED ON THE SIMULATOR). More... | |
bool | ipodDucking |
If YES, ipod music will duck (lower in volume) when the audio session activates. More... | |
bool | useHardwareIfAvailable |
Determines what to do if no other application is playing audio and allowIpod = YES (NOT SUPPORTED ON THE SIMULATOR). More... | |
bool | honorSilentSwitch |
If true, mute when backgrounded, screen locked, or the ringer switch is turned off (NOT SUPPORTED ON THE SIMULATOR). More... | |
bool | handleInterruptions |
If true, automatically handle interruptions. More... | |
float | preferredIOBufferDuration |
The preferred I/O buffer duration, in seconds. More... | |
bool | ipodPlaying |
If true, another application (usually iPod) is playing music. More... | |
bool | audioSessionActive |
If true, the audio session is active. More... | |
float | hardwareVolume |
Get the device's final hardware output volume, as controlled by the volume button on the side of the device. More... | |
bool | hardwareMuted |
Check if the hardware mute switch is on (not supported on the simulator or iOS 5+). More... | |
NSString * | audioRoute |
Check what hardware route the audio is taking, such as "Speaker" or "Headphone" (not supported on the simulator). More... | |
Properties inherited from <OALSuspendManager> | |
bool | suspended |
If YES, this object is suspended. More... | |
Properties inherited from <OALSuspendListener> | |
bool | manuallySuspended |
Set to YES to manually suspend. More... | |
bool | interrupted |
If YES, this object is interrupted. More... | |
Handles the audio session and interrupts.
- (void) forceEndInterruption |
Force an interrupt end.
This can be useful in cases where a buggy OS fails to end an interrupt.
Be VERY CAREFUL when using this!
- OALAudioSession: | (OALAudioSession) |
Singleton implementation providing "sharedInstance" and "purgeSharedInstance" methods.
- (OALAudioSupport*) sharedInstance: Get the shared singleton instance.
- (void) purgeSharedInstance: Purge (deallocate) the shared instance.
|
protected |
If true, the audio session was active when the interrupt occurred.
|
protected |
Flag signifying that we are currently handling an error notification.
This prevents onAudioError: from becoming reentrant due to self.manuallySuspended setting off a chain of calls that result in another error notification broadcast.
|
protected |
Marks the last time the audio session was reset due to error.
This is used to avoid getting stuck in a rapid-fire reset-error loop.
|
protected |
Handles suspending and interrupting for this object.
|
readwritenonatomicassign |
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.
If allowIpod = NO, the application will ALWAYS use hardware decoding.
Default value: YES
|
readnonatomicretain |
Check what hardware route the audio is taking, such as "Speaker" or "Headphone" (not supported on the simulator).
|
readwritenonatomicassign |
If true, the audio session is active.
|
readwritenonatomicretain |
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.
Default value: nil
|
readwritenonatomicassign |
If true, automatically handle interruptions.
Default value: YES
|
readnonatomicassign |
Check if the hardware mute switch is on (not supported on the simulator or iOS 5+).
Note: If headphones are plugged in, hardwareMuted will always return FALSE regardless of the switch state.
Note: Please file a bug report with Apple to get this functionality restored in iOS 5!
|
readnonatomicassign |
Get the device's final hardware output volume, as controlled by the volume button on the side of the device.
|
readwritenonatomicassign |
If true, mute when backgrounded, screen locked, or the ringer switch is turned off (NOT SUPPORTED ON THE SIMULATOR).
Default value: YES
|
readwritenonatomicassign |
If YES, ipod music will duck (lower in volume) when the audio session activates.
Default value: NO
|
readnonatomicassign |
If true, another application (usually iPod) is playing music.
|
readwritenonatomicassign |
The preferred I/O buffer duration, in seconds.
Lower values give less playback latencey, but use more CPU.
|
readwritenonatomicassign |
Determines what to do if no other application is playing audio and allowIpod = YES (NOT SUPPORTED ON THE SIMULATOR).
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.
Default value: YES