speaker property

AudioSpeakerKind get speaker

Returns the AudioSpeakerKind of these MediaDeviceDetails.

Only meaningful, if these MediaDeviceDetails are of MediaDeviceKind.audioOutput.

Implementation

AudioSpeakerKind get speaker => switch (deviceId()) {
  'ear-speaker' || 'ear-piece' => AudioSpeakerKind.earpiece,
  'speakerphone' || 'speaker' => AudioSpeakerKind.speaker,
  (_) => AudioSpeakerKind.headphones,
};