AudioFrameEntity.fromJson constructor

AudioFrameEntity.fromJson(
  1. dynamic data
)

Implementation

AudioFrameEntity.fromJson(data) {
  Map<String, dynamic> json =
      data is Map ? data.cast<String, dynamic>() : jsonDecode(data);
  this.data = json['data'];
  this.userId = json['userId'];
  this.channel = json['channel'];
  if (json['sampleRate'] != null)
    this.sampleRate = AudioSampleRateTool.getByInt(json['sampleRate']);
  this.timestamp = json['timestamp'];
}