Inherits from NSObject
Conforms to AVAudioSessionDelegate
OALSuspendManager
Declared in OALAudioSession.h

Overview

Handles the audio session and interrupts.

Tasks

  •   audioSessionCategory

    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
  •   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
  •   ipodDucking

    If YES, ipod music will duck (lower in volume) when the audio session activates.

    property
  •   useHardwareIfAvailable

    Determines what to do if no other application is playing audio and allowIpod = YES (NOT SUPPORTED ON THE SIMULATOR).

    property
  •   honorSilentSwitch

    If true, mute when backgrounded, screen locked, or the ringer switch is turned off (NOT SUPPORTED ON THE SIMULATOR).

    property
  •   handleInterruptions

    If true, automatically handle interruptions.

    property
  •   audioSessionDelegate

    Delegate that will receive all audio session events.

    property
  •   ipodPlaying

    If true, another application (usually iPod) is playing music.

    property
  •   audioSessionActive

    If true, the audio session is active

    property
  •   hardwareVolume

    Get the device’s final hardware output volume, as controlled by the volume button on the side of the device.

    property
  •   hardwareMuted

    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
  •   audioRoute

    Check what hardware route the audio is taking, such as “Speaker” or “Headphone” (not supported on the simulator).

    property
  • – forceEndInterruption

    Force 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 allowIpod

Discussion

If allowIpod = NO, the application will ALWAYS use hardware decoding.

See Also

Declared In

OALAudioSession.h

audioRoute

Check what hardware route the audio is taking, such as “Speaker” or “Headphone” (not supported on the simulator).

@property (readonly) NSString *audioRoute

Declared In

OALAudioSession.h

audioSessionActive

If true, the audio session is active

@property (readwrite, assign) bool audioSessionActive

Declared In

OALAudioSession.h

audioSessionCategory

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 *audioSessionCategory

Declared In

OALAudioSession.h

audioSessionDelegate

Delegate that will receive all audio session events.

@property (nonatomic, readwrite, assign) id<AVAudioSessionDelegate> audioSessionDelegate

Declared In

OALAudioSession.h

handleInterruptions

If true, automatically handle interruptions.

@property (nonatomic, readwrite, assign) bool handleInterruptions

Discussion

Default value: YES

Declared In

OALAudioSession.h

hardwareMuted

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 hardwareMuted

Declared In

OALAudioSession.h

hardwareVolume

Get the device’s final hardware output volume, as controlled by the volume button on the side of the device.

@property (readonly) float hardwareVolume

Declared In

OALAudioSession.h

honorSilentSwitch

If true, mute when backgrounded, screen locked, or the ringer switch is turned off (NOT SUPPORTED ON THE SIMULATOR).

@property (readwrite, assign) bool honorSilentSwitch

Discussion

Default value: YES

Declared In

OALAudioSession.h

ipodDucking

If YES, ipod music will duck (lower in volume) when the audio session activates.

@property (readwrite, assign) bool ipodDucking

Discussion

Default value: NO

Declared In

OALAudioSession.h

ipodPlaying

If true, another application (usually iPod) is playing music.

@property (readonly) bool ipodPlaying

Declared In

OALAudioSession.h

useHardwareIfAvailable

Determines what to do if no other application is playing audio and allowIpod = YES (NOT SUPPORTED ON THE SIMULATOR).

@property (readwrite, assign) bool useHardwareIfAvailable

Discussion

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

Declared In

OALAudioSession.h

Instance Methods

forceEndInterruption

Force an interrupt end. This can be useful in cases where a buggy OS fails to end an interrupt.

- (void)forceEndInterruption

Discussion

Be VERY CAREFUL when using this!

Declared In

OALAudioSession.h