-
Notifications
You must be signed in to change notification settings - Fork 2
AudioDeviceEventListener
Lejla Solak edited this page Jun 7, 2023
·
2 revisions
void onActiveAudioDeviceChanged(ActiveAudioDeviceChangedEvent activeAudioDeviceChangedEvent)
void onAvailableAudioDevicesChanged(AvailableAudioDevicesChangedEvent availableAudioDevicesChangedEvent)
Method that is triggered when the currently active audio device has changed.
-
activeAudioDeviceChangedEvent
:ActiveAudioDeviceChangedEvent
- An event instance containing a newly active audio device.
N/A
AudioDeviceEventListener audioDeviceEventListener = new DefaultAudioDeviceEventListener() {
@Override
public void onActiveAudioDeviceChanged(@NonNull ActiveAudioDeviceChangedEvent activeAudioDeviceChangedEvent) {
String name = activeAudioDeviceChangedEvent.getActiveAudioDevice().getName();
Log.d("WebRTC", String.format("Active audio device changed, now using %s", name));
}
});
Method that is triggered when the currently available audio devices have changed i.e. when a new audio device is connected or previously connected audio device is disconnected.
-
availableAudioDevicesChangedEvent
:AvailableAudioDevicesChangedEvent
- An event instance containing a set of newly available audio devices.
N/A
AudioDeviceEventListener audioDeviceEventListener = new DefaultAudioDeviceEventListener() {
@Override
public void onAvailableAudioDevicesChanged(@NonNull AvailableAudioDevicesChangedEvent availableAudioDevicesChangedEvent) {
Log.d("WebRTC", "Available audio devices have changed.");
updateListOfAvailableAudioDevices(availableAudioDevicesChangedEvent.getAvailableAudioDevices());
}
});