Function

AudioSessionInitialize

Initializes an iOS application’s audio session object.

Declaration

OSStatus AudioSessionInitialize(CFRunLoopRef inRunLoop, CFStringRef inRunLoopMode, AudioSessionInterruptionListener inInterruptionListener, void *inClientData);

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

Initializing and Activating an Audio Session

AudioSessionSetActive

Actives or deactivates your application’s audio session.

Deprecated
AudioSessionSetActiveWithFlags

Activates or deactivates your application’s audio session; provides flags for use by other audio sessions.

Deprecated