Skip to content

AudioDevice

Lejla Solak edited this page Jun 7, 2023 · 2 revisions



getAudioDeviceType()

Description

Getter for the audioDeviceType field.

Arguments

  • none

Returns

Example

@Override
public void onActiveAudioDeviceChanged(@NonNull ActiveAudioDeviceChangedEvent activeAudioDeviceChangedEvent) {
    AudioDeviceType audioDeviceType = activeAudioDeviceChangedEvent.getActiveAudioDevice().getAudioDeviceType();
    Log.d("WebRTC", "Active audio device type is: " + audioDeviceType);
}



getName()

Description

Getter for the name field.

Arguments

  • none

Returns

  • String - A human-readable name describing the audio device. If device has no name (such as speaker and earpiece), default name for that audio device type is used.

Example

@Override
public void onActiveAudioDeviceChanged(@NonNull ActiveAudioDeviceChangedEvent activeAudioDeviceChangedEvent) {
    String name = activeAudioDeviceChangedEvent.getActiveAudioDevice().getName();
    Log.d("WebRTC", "Name of active audio device is " + name);
}



getPriorityLevel()

Description

Getter for the priorityLevel field.

Arguments

  • none

Returns

  • int - The priority level of the audio device. The value ranges from 1 to 4, where 1 represents the lowest priority and 4 represents the highest priority level.

Example

@Override
public void onActiveAudioDeviceChanged(@NonNull ActiveAudioDeviceChangedEvent activeAudioDeviceChangedEvent) {
    int priorityLevel = activeAudioDeviceChangedEvent.getActiveAudioDevice().getPriorityLevel();
    Log.d("WebRTC", "Active audio device has prioriy level " + priorityLevel);
}

Tutorials

Migration guides

Reference documentation

Clone this wiki locally