AudioDeviceInfo

The AudioDeviceInfo class that contains the ID, name and type of the audio devices.

@JsonSerializable(explicitToJson: true, includeIfNull: false)
class AudioDeviceInfo {
  const AudioDeviceInfo({this.deviceId, this.deviceTypeName, this.deviceName});

  @JsonKey(name: 'deviceId')
  final String? deviceId;

  @JsonKey(name: 'deviceTypeName')
  final String? deviceTypeName;

  @JsonKey(name: 'deviceName')
  final String? deviceName;

  factory AudioDeviceInfo.fromJson(Map<String, dynamic> json) =>
      _$AudioDeviceInfoFromJson(json);

  Map<String, dynamic> toJson() => _$AudioDeviceInfoToJson(this);
}

Attributes

deviceId
The device ID.
deviceName
The device name.
deviceTypeName
Output parameter; indicates the type of audio devices, such as built-in, USB and HDMI.