Contents

AudioSessionInitialize(_:_:_:_:)

Initializes an iOS application’s audio session object.

Declaration

func AudioSessionInitialize(_ inRunLoop: CFRunLoop!, _ inRunLoopMode: CFString!, _ inInterruptionListener: AudioSessionInterruptionListener!, _ inClientData: UnsafeMutableRawPointer!) -> OSStatus

Parameters

  • inRunLoop:

    The run loop that the interruption listener callback should be run on. Pass NULL to use the main run loop.

  • inRunLoopMode:

    The mode for the run loop that the interruption listener function will run on. Passing NULL is equivalent to passing kCFRunLoopDefaultMode.

  • 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