switchAudioDevice method

Future<void> switchAudioDevice(
  1. AudioDeviceInfo device
)

Switches the audio output device for the local participant.

  • This method allows you to change the active audio output device (for example, speakers, headphones, or external audio devices).

You can retrieve the list of available audio output devices using VideoSDK.getAudioDevices.

Parameters

  • device: The AudioDeviceInfo representing the audio output device to switch to.

Example

// Get available audio output devices
final audioDevices = await VideoSDK.getAudioDevices();

// Switch to a specific audio output device
await room.switchAudioDevice(audioDevices.first);

Implementation

Future<void> switchAudioDevice(AudioDeviceInfo device) =>
    _switchAudioDevice(device);