AudioPcm.fromJson constructor

AudioPcm.fromJson(
  1. Map<String, dynamic> json
)

Creates from JSON.

Implementation

factory AudioPcm.fromJson(Map<String, dynamic> json) {
  if (json['type'] != 'audio/pcm') {
    throw FormatException(
      'AudioPcm.fromJson expected type "audio/pcm", got ${json['type']}',
    );
  }
  return AudioPcm(rate: json['rate'] as int?);
}