TrackInfo.fromJson constructor
TrackInfo.fromJson(
- Map<String, dynamic> json
)
Implementation
factory TrackInfo.fromJson(Map<String, dynamic> json) {
return TrackInfo(
duration: (json['duration'] as num).toDouble(),
sampleMd5: double.tryParse(json['sample_md5'] ?? '0') ?? 0,
offsetSeconds: (json['offset_seconds'] as num).toDouble(),
windowSeconds: json['window_seconds'] as int,
analysisSampleRate: json['analysis_sample_rate'] as int,
analysisChannels: json['analysis_channels'] as int,
endOfFadeIn: json['end_of_fade_in'] as int,
startOfFadeOut: json['start_of_fade_out'] as int,
loudness: (json['loudness'] as num).toDouble(),
tempo: (json['tempo'] as num).toDouble(),
tempoConfidence: (json['tempo_confidence'] as num).toDouble(),
timeSignature: json['time_signature'] as int,
timeSignatureConfidence: (json['time_signature_confidence'] as num).toDouble(),
key: json['key'] as int,
keyConfidence: (json['key_confidence'] as num).toDouble(),
mode: json['mode'] as int,
modeConfidence: (json['mode_confidence'] as num).toDouble(),
codestring: json['codestring'] as String,
codeVersion: json['code_version'] as int,
echoprintstring: json['echoprintstring'] as String,
echoprintVersion: json['echoprint_version'] as int,
synchstring: json['synchstring'] as String,
synchVersion: json['synch_version'] as int,
rhythmstring: json['rhythmstring'] as String,
rhythmVersion: json['rhythm_version'] as int,
);
}