MicrophoneDeviceInfo class
Represents information about an audio input or output device.
- This class extends DeviceInfo.
- It provides metadata about audio devices such as microphones and speakers.
- Instances of this class are returned by VideoSDK.getMics().
Depending on the value of kind, a MicrophoneDeviceInfo instance may represent:
- An audio input device (
audioinput), such as a microphone. - An audio output device (
audiooutput), such as a speaker.
Example
List<MicrophoneDeviceInfo> mics = [];
List<MicrophoneDeviceInfo> speakers = [];
final List<MicrophoneDeviceInfo>? audioDevices =
await VideoSDK.getMics();
if (audioDevices != null) {
for (final device in audioDevices) {
if (device.kind == 'audioinput') {
mics.add(device);
} else if (device.kind == 'audiooutput') {
speakers.add(device);
}
}
print('Microphones: ${mics.length}');
print('Speakers: ${speakers.length}');
}
- Inheritance
-
- Object
- MediaDeviceInfo
- DeviceInfo
- MicrophoneDeviceInfo
Constructors
- MicrophoneDeviceInfo({required String deviceId, String? groupId, String? kind, required String label})
-
Describes a microphone or speaker by its
deviceId.
Properties
- deviceId → String
-
Platform-assigned identifier for the device.
finalinherited
- groupId → String?
-
Groups devices that belong to the same physical hardware — a headset's
microphone and speaker share a
groupId. Null where the platform does not report one.finalinherited - kind → String?
-
audioinput,audiooutputorvideoinput.finalinherited - label → String
-
Human-readable name, as reported by the platform.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited