BaseAudioContext.fromJson constructor

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

Implementation

factory BaseAudioContext.fromJson(Map<String, dynamic> json) {
  return BaseAudioContext(
    contextId: GraphObjectId.fromJson(json['contextId'] as String),
    contextType: ContextType.fromJson(json['contextType'] as String),
    contextState: ContextState.fromJson(json['contextState'] as String),
    realtimeData:
        json.containsKey('realtimeData')
            ? ContextRealtimeData.fromJson(
              json['realtimeData'] as Map<String, dynamic>,
            )
            : null,
    callbackBufferSize: json['callbackBufferSize'] as num,
    maxOutputChannelCount: json['maxOutputChannelCount'] as num,
    sampleRate: json['sampleRate'] as num,
  );
}