checkDeviceIsHeadphone method

bool checkDeviceIsHeadphone({
  1. required AudioDevice device,
})

Implementation

bool checkDeviceIsHeadphone({required AudioDevice device}) {
  if (device.type == AudioDeviceType.wiredHeadset ||
      device.type == AudioDeviceType.wiredHeadphones ||
      device.type == AudioDeviceType.headsetMic) {
    return true;
  }
  return false;
}