AudioToolbox.AudioSession.Initialize Method
Initializes the Audio Session.

Syntax

public static void Initialize (CoreFoundation.CFRunLoop runLoop, string runMode)

Parameters

runLoop
The runloop to execute on.
runMode
Run loop mode (see Foundation.CFRunLoop for the various modes).

Remarks

In addition to calling the Initialize method on AudioSession, you will want to set the AudioSession.Category and the AudioSession.Mode properties to control the priority of your audio and the rules for mixing your audio with other audio playing on the device.

When you call this variation of Initialize, both the AudioSession.Interrupted and AudioSession.Resumed events are raised on the specified run loop with the specified run loop mode. Use the AudioSession.Initialize() if you want those events to be raised on the main thread.

C# Example

var myRunLoop = CFRunLoop.Current;
var myRunMode = CFRunLoop.CFDefaultRunLoopMode;
//
// Initialize the audio session for audio playback
//
AudioSession.Initialize (myRunLoop, myRunMode);
AudioSession.Category = AudioSessionCategory.MediaPlayback;

Requirements

Namespace: AudioToolbox
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0