audio_waveforms
audio_waveforms copied to clipboard
WaveData is all 0 on Xiaomi phones, no data can be obtained
recorderController ??= RecorderController() ..androidEncoder = AndroidEncoder.aac ..androidOutputFormat = AndroidOutputFormat.mpeg4 ..iosEncoder = IosEncoder.kAudioFormatMPEG4AAC ..sampleRate = 44100 ..bitRate = 48000;
updateStatus(SoundsMessageStatus.recording);
// 录制状态
recorderController?.onRecorderStateChanged.listen((state) {
onStateChanged?.call(state);
});
// 时间间隔
recorderController?.onCurrentDuration.listen((value) {
duration.value = value;
if (value.inSeconds >= 60) {
endRec();
}
onDurationChanged?.call(value);
amplitudeList.value = recorderController!.waveData.reversed.toList();
print('duration=====$duration ');
print('amplitudeList------------${amplitudeList}');
});
// 录制
await recorderController!.record(); // Path is optional
And this function is not get data
I also encountered a similar problem. On all of Xiaomi's products, it was impossible to obtain the decibel value.