AudioSessionInitialize(_:_:_:_:)
Initializes an iOS application’s audio session object.
Declaration
func AudioSessionInitialize(_ inRunLoop: CFRunLoop!, _ inRunLoopMode: CFString!, _ inInterruptionListener: AudioSessionInterruptionListener!, _ inClientData: UnsafeMutableRawPointer!) -> OSStatusParameters
- inRunLoop:
The run loop that the interruption listener callback should be run on. Pass
NULLto use the main run loop. - inRunLoopMode:
The mode for the run loop that the interruption listener function will run on. Passing
NULLis equivalent to passingkCFRunLoopDefaultMode. - inInterruptionListener:
The interruption listener callback function. The application’s audio session object invokes the callback when the session is interrupted and (if the application is still running) when the interruption ends. Can be
NULL. See Audiosessioninterruptionlistener. - inClientData:
Data that you would like to be passed to your interruption listener callback.
Return Value
A result code. See Result Codes.
Discussion
Your application must call this function before making any other Audio Session Services calls. You may activate and deactivate your audio session as needed (see AudioSessionSetActive(_:)), but should initialize it only once.
See Also
Functions
AudioFileReadPackets(_:_:_:_:_:_:_:)AudioComponentGetIcon(_:_:)AudioComponentGetLastActiveTime(_:)AudioHardwareServiceAddPropertyListener(_:_:_:_:)AudioHardwareServiceGetPropertyData(_:_:_:_:_:_:)AudioHardwareServiceGetPropertyDataSize(_:_:_:_:_:)AudioHardwareServiceHasProperty(_:_:)AudioHardwareServiceIsPropertySettable(_:_:_:)AudioHardwareServiceRemovePropertyListener(_:_:_:_:)AudioHardwareServiceSetPropertyData(_:_:_:_:_:_:)AudioOutputUnitGetHostIcon(_:_:)AudioOutputUnitPublish(_:_:_:_:)AudioSessionAddPropertyListener(_:_:_:)AudioSessionGetProperty(_:_:_:)AudioSessionGetPropertySize(_:_:)