Agora RTC Objective-C API Reference Refactor

Public Member Functions
IAudioDeviceManagerObserver Class Referenceabstract

## Public Member Functions
virtual void | onDeviceStateChanged ()=0
virtual void | onAudioDeviceStateChanged (const char *deviceId, int deviceType, int deviceState)=0
virtual void | onVolumeIndication (int deviceType, int volume)=0
virtual void | onRoutingChanged (AudioRoute route)=0
virtual void | onAudioDeviceVolumeChanged (int deviceType, int volume, bool muted)=0

## Detailed Description

The IAudioDeviceManagerObserver class.

## Constructor & Destructor Documentation

## ◆ ~IAudioDeviceManagerObserver()

virtual ~IAudioDeviceManagerObserver | ( |  | ) |
| inline virtual

## Member Function Documentation

## ◆ onDeviceStateChanged()

virtual void onDeviceStateChanged | ( |  | ) |
| pure virtual

Occurs when the device state changes, for example, when a device is added or removed.

To get the current information of the connected audio devices, call getNumberOfPlayoutDevices.

## ◆ onAudioDeviceStateChanged()

virtual void onAudioDeviceStateChanged | ( | const char * | deviceId,
|  | int | deviceType,
|  | int | deviceState
| ) |  |
| pure virtual

Occurs when the device state changes, for example, when a device is added or removed or default device change.

Note
  This method applies to Windows only now.

Parameters

  deviceId | Pointer to the device ID.
  deviceType | Device type: MEDIA_DEVICE_TYPE.
  deviceState | Device state: MEDIA_DEVICE_STATE_TYPE..

## ◆ onVolumeIndication()

virtual void onVolumeIndication | ( | int | deviceType,
|  | int | volume
| ) |  |
| pure virtual

Indicates incoming volume. This can be used to test microphone or speaker.

Parameters

  deviceType | Device type: MEDIA_DEVICE_TYPE.
  volume | volume between 0 (lowest volume) to 255 (highest volume).

## ◆ onRoutingChanged()

virtual void onRoutingChanged | ( | AudioRoute | route | ) |
| pure virtual

Occurs when the audio route changes.

Parameters

  route | The current audio route. See AudioRoute.

## ◆ onAudioDeviceVolumeChanged()

virtual void onAudioDeviceVolumeChanged | ( | int | deviceType,
|  | int | volume,
|  | bool | muted
| ) |  |
| pure virtual

Occurs when the audio device volume changes.

Parameters

  deviceType | The device type, see MEDIA_DEVICE_TYPE.
  volume | The volume of the audio device.
  muted | Whether the audio device is muted: true: The audio device is muted. false: The audio device is not muted.