One Logo Pool Ball
AVFAudio · IOS API REFERENCE

AVAudioSession

class · iOS 3.0+ · SDK 27.1

class AVAudioSession

Members (94)

get · iOS 26.0+

availableInputsChangeNotification

TypeScript
static get availableInputsChangeNotification(): _Foundation_NSNotification_Name
Swift declaration
class let availableInputsChangeNotification: NSNotification.Name
get · iOS 27.0+

deactivationContextKey

TypeScript
static get deactivationContextKey(): string
Swift declaration
class let deactivationContextKey: String
get · iOS 27.0+

didBecomeActiveNotification

TypeScript
static get didBecomeActiveNotification(): _Foundation_NSNotification_Name
Swift declaration
class let didBecomeActiveNotification: NSNotification.Name
get · iOS 27.0+

didBecomeInactiveNotification

TypeScript
static get didBecomeInactiveNotification(): _Foundation_NSNotification_Name
Swift declaration
class let didBecomeInactiveNotification: NSNotification.Name
get · iOS 6.0+

interruptionNotification

TypeScript
static get interruptionNotification(): _Foundation_NSNotification_Name
Swift declaration
class let interruptionNotification: NSNotification.Name
get · iOS 7.0+

mediaServicesWereLostNotification

TypeScript
static get mediaServicesWereLostNotification(): _Foundation_NSNotification_Name
Swift declaration
class let mediaServicesWereLostNotification: NSNotification.Name
get · iOS 6.0+

mediaServicesWereResetNotification

TypeScript
static get mediaServicesWereResetNotification(): _Foundation_NSNotification_Name
Swift declaration
class let mediaServicesWereResetNotification: NSNotification.Name
get · iOS 18.2+

microphoneInjectionCapabilitiesChangeNotification

TypeScript
static get microphoneInjectionCapabilitiesChangeNotification(): _Foundation_NSNotification_Name
Swift declaration
class let microphoneInjectionCapabilitiesChangeNotification: NSNotification.Name
get · iOS 26.0+

muteStateKey

TypeScript
static get muteStateKey(): string
Swift declaration
class let muteStateKey: String
get · iOS 26.0+

outputMuteStateChangeNotification

TypeScript
static get outputMuteStateChangeNotification(): _Foundation_NSNotification_Name
Swift declaration
class let outputMuteStateChangeNotification: NSNotification.Name
get · iOS 17.2+

renderingCapabilitiesChangeNotification

TypeScript
static get renderingCapabilitiesChangeNotification(): _Foundation_NSNotification_Name
Swift declaration
class let renderingCapabilitiesChangeNotification: NSNotification.Name
get · iOS 17.2+

renderingModeChangeNotification

TypeScript
static get renderingModeChangeNotification(): _Foundation_NSNotification_Name
Swift declaration
class let renderingModeChangeNotification: NSNotification.Name
get · iOS 27.0+

resumptionContextKey

TypeScript
static get resumptionContextKey(): string
Swift declaration
class let resumptionContextKey: String
get · iOS 27.0+

resumptionRecommendationNotification

TypeScript
static get resumptionRecommendationNotification(): _Foundation_NSNotification_Name
Swift declaration
class let resumptionRecommendationNotification: NSNotification.Name
get · iOS 6.0+

routeChangeNotification

TypeScript
static get routeChangeNotification(): _Foundation_NSNotification_Name
Swift declaration
class let routeChangeNotification: NSNotification.Name
get · iOS 8.0+

silenceSecondaryAudioHintNotification

TypeScript
static get silenceSecondaryAudioHintNotification(): _Foundation_NSNotification_Name
Swift declaration
class let silenceSecondaryAudioHintNotification: NSNotification.Name
get · iOS 15.0+

spatialPlaybackCapabilitiesChangedNotification

TypeScript
static get spatialPlaybackCapabilitiesChangedNotification(): _Foundation_NSNotification_Name
Swift declaration
class let spatialPlaybackCapabilitiesChangedNotification: NSNotification.Name
get · iOS 26.0+

userIntentToUnmuteOutputNotification

TypeScript
static get userIntentToUnmuteOutputNotification(): _Foundation_NSNotification_Name
Swift declaration
class let userIntentToUnmuteOutputNotification: NSNotification.Name
static · iOS 3.0+

sharedInstance

TypeScript
static sharedInstance(): AVAudioSession
Swift declaration
class func sharedInstance() -> AVAudioSession
method · iOS 27.0+

activate

TypeScript
activate(options: AVAudioSessionActivationOptions, handler: ((arg0: boolean, arg1: (NativeError) | null) => void)): void
Swift declaration
func activate(options: AVAudioSessionActivationOptions = []) async throws -> Bool
method · iOS 27.0+

deactivate

TypeScript
deactivate(options: AVAudioSessionDeactivationOptions, handler: ((arg0: boolean, arg1: (NativeError) | null) => void)): void
Swift declaration
func deactivate(options: AVAudioSessionDeactivationOptions = []) async throws -> Bool
init

init

TypeScript
static init(): AVAudioSession
Swift declaration
init()
method · iOS 6.0+

overrideOutputAudioPort

TypeScript
overrideOutputAudioPort(portOverride: AVAudioSession_PortOverride): void
Swift declaration
func overrideOutputAudioPort(_ portOverride: AVAudioSession.PortOverride) throws
method · iOS 7.0+ · Deprecated in iOS 17.0

requestRecordPermission

TypeScript
requestRecordPermission(response: ((arg0: boolean) => void)): void
Swift declaration
func requestRecordPermission(_ response: @escaping (Bool) -> Void)
method · iOS 6.0+

setActive

TypeScript
setActive(active: boolean, options?: AVAudioSession_SetActiveOptions): void
Swift declaration
func setActive(_ active: Bool, options: AVAudioSession.SetActiveOptions = []) throws
method · iOS 10.0+

setAggregatedIOPreference

TypeScript
setAggregatedIOPreference(inIOType: AVAudioSession_IOType): void
Swift declaration
func setAggregatedIOPreference(_ inIOType: AVAudioSession.IOType) throws
method · iOS 13.0+

setAllowHapticsAndSystemSoundsDuringRecording

TypeScript
setAllowHapticsAndSystemSoundsDuringRecording(inValue: boolean): void
Swift declaration
func setAllowHapticsAndSystemSoundsDuringRecording(_ inValue: Bool) throws
method · iOS 3.0+

setCategory

TypeScript
setCategory(category: AVAudioSession_Category): void
Swift declaration
func setCategory(_ category: AVAudioSession.Category) throws
method · iOS 10.0+

setCategory

TypeScript
setCategoryModeOptions(category: AVAudioSession_Category, mode: AVAudioSession_Mode, options?: AVAudioSession_CategoryOptions): void
Swift declaration
func setCategory(_ category: AVAudioSession.Category, mode: AVAudioSession.Mode, options: AVAudioSession.CategoryOptions = []) throws
method · iOS 11.0+

setCategory

TypeScript
setCategoryModePolicyOptions(category: AVAudioSession_Category, mode: AVAudioSession_Mode, policy: AVAudioSession_RouteSharingPolicy, options?: AVAudioSession_CategoryOptions): void
Swift declaration
func setCategory(_ category: AVAudioSession.Category, mode: AVAudioSession.Mode, policy: AVAudioSession.RouteSharingPolicy, options: AVAudioSession.CategoryOptions = []) throws
method · iOS 6.0+

setCategory

TypeScript
setCategoryOptions(category: AVAudioSession_Category, options?: AVAudioSession_CategoryOptions): void
Swift declaration
func setCategory(_ category: AVAudioSession.Category, options: AVAudioSession.CategoryOptions = []) throws
method · iOS 6.0+

setInputDataSource

TypeScript
setInputDataSource(dataSource?: (AVAudioSessionDataSourceDescription) | null): void
Swift declaration
func setInputDataSource(_ dataSource: AVAudioSessionDataSourceDescription?) throws
method · iOS 6.0+

setInputGain

TypeScript
setInputGain(gain: number): void
Swift declaration
func setInputGain(_ gain: Float) throws
method · iOS 5.0+

setMode

TypeScript
setMode(mode: AVAudioSession_Mode): void
Swift declaration
func setMode(_ mode: AVAudioSession.Mode) throws
method · iOS 6.0+

setOutputDataSource

TypeScript
setOutputDataSource(dataSource?: (AVAudioSessionDataSourceDescription) | null): void
Swift declaration
func setOutputDataSource(_ dataSource: AVAudioSessionDataSourceDescription?) throws
method · iOS 26.0+

setOutputMuted

TypeScript
setOutputMuted(muted: boolean): void
Swift declaration
func setOutputMuted(_ muted: Bool) throws
method · iOS 3.0+

setPreferredIOBufferDuration

TypeScript
setPreferredIOBufferDuration(duration: number): void
Swift declaration
func setPreferredIOBufferDuration(_ duration: TimeInterval) throws
method · iOS 7.0+

setPreferredInput

TypeScript
setPreferredInput(inPort?: (AVAudioSessionPortDescription) | null): void
Swift declaration
func setPreferredInput(_ inPort: AVAudioSessionPortDescription?) throws
method · iOS 7.0+

setPreferredInputNumberOfChannels

TypeScript
setPreferredInputNumberOfChannels(count: number): void
Swift declaration
func setPreferredInputNumberOfChannels(_ count: Int) throws
method · iOS 14.0+

setPreferredInputOrientation

TypeScript
setPreferredInputOrientation(orientation: AVAudioSession_StereoOrientation): void
Swift declaration
func setPreferredInputOrientation(_ orientation: AVAudioSession.StereoOrientation) throws
method · iOS 18.2+

setPreferredMicrophoneInjectionMode

TypeScript
setPreferredMicrophoneInjectionMode(inValue: AVAudioSession_MicrophoneInjectionMode): void
Swift declaration
func setPreferredMicrophoneInjectionMode(_ inValue: AVAudioSession.MicrophoneInjectionMode) throws
method · iOS 7.0+

setPreferredOutputNumberOfChannels

TypeScript
setPreferredOutputNumberOfChannels(count: number): void
Swift declaration
func setPreferredOutputNumberOfChannels(_ count: Int) throws
method · iOS 6.0+

setPreferredSampleRate

TypeScript
setPreferredSampleRate(sampleRate: number): void
Swift declaration
func setPreferredSampleRate(_ sampleRate: Double) throws
method · iOS 18.2+

setPrefersEchoCancelledInput

TypeScript
setPrefersEchoCancelledInput(value: boolean): void
Swift declaration
func setPrefersEchoCancelledInput(_ value: Bool) throws
method · iOS 17.0+

setPrefersInterruptionOnRouteDisconnect

TypeScript
setPrefersInterruptionOnRouteDisconnect(inValue: boolean): void
Swift declaration
func setPrefersInterruptionOnRouteDisconnect(_ inValue: Bool) throws
method · iOS 14.5+

setPrefersNoInterruptionsFromSystemAlerts

TypeScript
setPrefersNoInterruptionsFromSystemAlerts(inValue: boolean): void
Swift declaration
func setPrefersNoInterruptionsFromSystemAlerts(_ inValue: Bool) throws
method · iOS 15.0+

setSupportsMultichannelContent

TypeScript
setSupportsMultichannelContent(inValue: boolean): void
Swift declaration
func setSupportsMultichannelContent(_ inValue: Bool) throws
get · iOS 6.0+

ioBufferDuration

TypeScript
get ioBufferDuration(): number
Swift declaration
var ioBufferDuration: TimeInterval { get }
get · iOS 13.0+

allowHapticsAndSystemSoundsDuringRecording

TypeScript
get allowHapticsAndSystemSoundsDuringRecording(): boolean
Swift declaration
var allowHapticsAndSystemSoundsDuringRecording: Bool { get }
get · iOS 9.0+

availableCategories

TypeScript
get availableCategories(): Array<AVAudioSession_Category>
Swift declaration
var availableCategories: [AVAudioSession.Category] { get }
get · iOS 7.0+

availableInputs

TypeScript
get availableInputs(): (Array<AVAudioSessionPortDescription>) | null
Swift declaration
var availableInputs: [AVAudioSessionPortDescription]? { get }
get · iOS 9.0+

availableModes

TypeScript
get availableModes(): Array<AVAudioSession_Mode>
Swift declaration
var availableModes: [AVAudioSession.Mode] { get }
get · iOS 3.0+

category

TypeScript
get category(): AVAudioSession_Category
Swift declaration
var category: AVAudioSession.Category { get }
get · iOS 6.0+

categoryOptions

TypeScript
get categoryOptions(): AVAudioSession_CategoryOptions
Swift declaration
var categoryOptions: AVAudioSession.CategoryOptions { get }
get · iOS 6.0+

currentRoute

TypeScript
get currentRoute(): AVAudioSessionRouteDescription
Swift declaration
var currentRoute: AVAudioSessionRouteDescription { get }
get · iOS 6.0+

isInputAvailable

TypeScript
get isInputAvailable(): boolean
Swift declaration
var isInputAvailable: Bool { get }
get · iOS 6.0+

inputDataSource

TypeScript
get inputDataSource(): (AVAudioSessionDataSourceDescription) | null
Swift declaration
var inputDataSource: AVAudioSessionDataSourceDescription? { get }
get · iOS 6.0+

inputDataSources

TypeScript
get inputDataSources(): (Array<AVAudioSessionDataSourceDescription>) | null
Swift declaration
var inputDataSources: [AVAudioSessionDataSourceDescription]? { get }
get · iOS 6.0+

inputGain

TypeScript
get inputGain(): number
Swift declaration
var inputGain: Float { get }
get · iOS 6.0+

isInputGainSettable

TypeScript
get isInputGainSettable(): boolean
Swift declaration
var isInputGainSettable: Bool { get }
get · iOS 6.0+

inputLatency

TypeScript
get inputLatency(): number
Swift declaration
var inputLatency: TimeInterval { get }
get · iOS 6.0+

inputNumberOfChannels

TypeScript
get inputNumberOfChannels(): number
Swift declaration
var inputNumberOfChannels: Int { get }
get · iOS 14.0+

inputOrientation

TypeScript
get inputOrientation(): AVAudioSession_StereoOrientation
Swift declaration
var inputOrientation: AVAudioSession.StereoOrientation { get }
get · iOS 18.2+

isEchoCancelledInputAvailable

TypeScript
get isEchoCancelledInputAvailable(): boolean
Swift declaration
var isEchoCancelledInputAvailable: Bool { get }
get · iOS 18.2+

isEchoCancelledInputEnabled

TypeScript
get isEchoCancelledInputEnabled(): boolean
Swift declaration
var isEchoCancelledInputEnabled: Bool { get }
get · iOS 18.2+

isMicrophoneInjectionAvailable

TypeScript
get isMicrophoneInjectionAvailable(): boolean
Swift declaration
var isMicrophoneInjectionAvailable: Bool { get }
get · iOS 7.0+

maximumInputNumberOfChannels

TypeScript
get maximumInputNumberOfChannels(): number
Swift declaration
var maximumInputNumberOfChannels: Int { get }
get · iOS 7.0+

maximumOutputNumberOfChannels

TypeScript
get maximumOutputNumberOfChannels(): number
Swift declaration
var maximumOutputNumberOfChannels: Int { get }
get · iOS 5.0+

mode

TypeScript
get mode(): AVAudioSession_Mode
Swift declaration
var mode: AVAudioSession.Mode { get }
get · iOS 6.0+

isOtherAudioPlaying

TypeScript
get isOtherAudioPlaying(): boolean
Swift declaration
var isOtherAudioPlaying: Bool { get }
get · iOS 6.0+

outputDataSource

TypeScript
get outputDataSource(): (AVAudioSessionDataSourceDescription) | null
Swift declaration
var outputDataSource: AVAudioSessionDataSourceDescription? { get }
get · iOS 6.0+

outputDataSources

TypeScript
get outputDataSources(): (Array<AVAudioSessionDataSourceDescription>) | null
Swift declaration
var outputDataSources: [AVAudioSessionDataSourceDescription]? { get }
get · iOS 6.0+

outputLatency

TypeScript
get outputLatency(): number
Swift declaration
var outputLatency: TimeInterval { get }
get · iOS 26.0+

isOutputMuted

TypeScript
get isOutputMuted(): boolean
Swift declaration
var isOutputMuted: Bool { get }
get · iOS 6.0+

outputNumberOfChannels

TypeScript
get outputNumberOfChannels(): number
Swift declaration
var outputNumberOfChannels: Int { get }
get · iOS 6.0+

outputVolume

TypeScript
get outputVolume(): number
Swift declaration
var outputVolume: Float { get }
get · iOS 3.0+

preferredIOBufferDuration

TypeScript
get preferredIOBufferDuration(): number
Swift declaration
var preferredIOBufferDuration: TimeInterval { get }
get · iOS 7.0+

preferredInput

TypeScript
get preferredInput(): (AVAudioSessionPortDescription) | null
Swift declaration
var preferredInput: AVAudioSessionPortDescription? { get }
get · iOS 7.0+

preferredInputNumberOfChannels

TypeScript
get preferredInputNumberOfChannels(): number
Swift declaration
var preferredInputNumberOfChannels: Int { get }
get · iOS 14.0+

preferredInputOrientation

TypeScript
get preferredInputOrientation(): AVAudioSession_StereoOrientation
Swift declaration
var preferredInputOrientation: AVAudioSession.StereoOrientation { get }
get · iOS 18.2+

preferredMicrophoneInjectionMode

TypeScript
get preferredMicrophoneInjectionMode(): AVAudioSession_MicrophoneInjectionMode
Swift declaration
var preferredMicrophoneInjectionMode: AVAudioSession.MicrophoneInjectionMode { get }
get · iOS 7.0+

preferredOutputNumberOfChannels

TypeScript
get preferredOutputNumberOfChannels(): number
Swift declaration
var preferredOutputNumberOfChannels: Int { get }
get · iOS 6.0+

preferredSampleRate

TypeScript
get preferredSampleRate(): number
Swift declaration
var preferredSampleRate: Double { get }
get · iOS 18.2+

prefersEchoCancelledInput

TypeScript
get prefersEchoCancelledInput(): boolean
Swift declaration
var prefersEchoCancelledInput: Bool { get }
get · iOS 17.0+

prefersInterruptionOnRouteDisconnect

TypeScript
get prefersInterruptionOnRouteDisconnect(): boolean
Swift declaration
var prefersInterruptionOnRouteDisconnect: Bool { get }
get · iOS 14.5+

prefersNoInterruptionsFromSystemAlerts

TypeScript
get prefersNoInterruptionsFromSystemAlerts(): boolean
Swift declaration
var prefersNoInterruptionsFromSystemAlerts: Bool { get }
get · iOS 13.0+

promptStyle

TypeScript
get promptStyle(): AVAudioSession_PromptStyle
Swift declaration
var promptStyle: AVAudioSession.PromptStyle { get }
get · iOS 8.0+ · Deprecated in iOS 17.0

recordPermission

TypeScript
get recordPermission(): AVAudioSession_RecordPermission
Swift declaration
var recordPermission: AVAudioSession.RecordPermission { get }
get · iOS 17.2+

renderingMode

TypeScript
get renderingMode(): AVAudioSession_RenderingMode
Swift declaration
var renderingMode: AVAudioSession.RenderingMode { get }
get · iOS 11.0+

routeSharingPolicy

TypeScript
get routeSharingPolicy(): AVAudioSession_RouteSharingPolicy
Swift declaration
var routeSharingPolicy: AVAudioSession.RouteSharingPolicy { get }
get · iOS 6.0+

sampleRate

TypeScript
get sampleRate(): number
Swift declaration
var sampleRate: Double { get }
get · iOS 8.0+

secondaryAudioShouldBeSilencedHint

TypeScript
get secondaryAudioShouldBeSilencedHint(): boolean
Swift declaration
var secondaryAudioShouldBeSilencedHint: Bool { get }
get · iOS 17.2+

supportedOutputChannelLayouts

TypeScript
get supportedOutputChannelLayouts(): Array<AVAudioChannelLayout>
Swift declaration
var supportedOutputChannelLayouts: [AVAudioChannelLayout] { get }
get · iOS 15.0+

supportsMultichannelContent

TypeScript
get supportsMultichannelContent(): boolean
Swift declaration
var supportsMultichannelContent: Bool { get }

Skipped declarations

No declarations were skipped in this snapshot.

All AVFAudio types →