# OTAudioDeviceManager Class Reference

Inherits from | NSObject
Declared in | OTAudioKit.h

## Overview

Use the AudioDeviceManager to set a custom audio device to be used by the app. The audio device manages access to the audio capturing and rendering hardware.

You can only define a single audio capture source and rendering target for the entire process. You cannot set these individually for each publisher and subscriber. You can, however, set the audio bitrate for a published stream by setting the [OTPublisherKitSettings audioBitrate] property.

### `+ setAudioDevice:`

Sets the audio device to be used.

`+ (void)setAudioDevice:(_Nullable id<OTAudioDevice>)device`

#### Parameters

`device` | The OTAudioDevice interface implementation. This object is retained.

#### Discussion

You must call this method before you connect to a session. Additionally, this is a global operation that must persist throughout the lifetime of an application.

If you do not call this method, the app uses the iOS device’s microphone and speaker.

#### Declared In

`OTAudioKit.h`

### `+ currentAudioDevice`

Gets the OTAudioDevice instance.

`+ (_Nullable id<OTAudioDevice>)currentAudioDevice`

#### Return Value

id The OTAudioDevice implementation.

#### Declared In

`OTAudioKit.h`

### `+ currentAudioSessionManager`

Gets the OTAudioSessionManager instance, if the current audio device supports it.

`+ (_Nullable id<OTAudioSessionManager>)currentAudioSessionManager`

#### Return Value

id The OTAudioSessionManager implementation, or `nil` if unsupported.

#### Discussion

This returns the same instance as `currentAudioDevice` if it conforms to the OTAudioSessionManager protocol. Otherwise, returns `nil`.

Note: Currently only the default audio device supports this protocol.

For more information, see this documentation.

#### Declared In

`OTAudioKit.h`