enumerateMicDevices method

Future<List<MediaDeviceInfo>> enumerateMicDevices()

Implementation

Future<List<MediaDeviceInfo>> enumerateMicDevices() async {
  List<MediaDeviceInfo> devices =
      await navigator.mediaDevices.enumerateDevices();

  List<MediaDeviceInfo> micDevices = devices
      .where((device) => device.kind?.toLowerCase() == 'audiooutput')
      .toList();

  return micDevices;
}