switchAudioDevice method

Future<void> switchAudioDevice(
  1. MediaDeviceInfo device
)

Implementation

Future<void> switchAudioDevice(MediaDeviceInfo device) async {
  audioOutputDevice = device;
  await navigator.mediaDevices.selectAudioOutput(
    AudioOutputOptions(
      deviceId: audioOutputDevice!.deviceId,
    ),
  );
}