audio_waveforms icon indicating copy to clipboard operation
audio_waveforms copied to clipboard

WaveData is all 0 on Xiaomi phones, no data can be obtained

Open Z-p-github opened this issue 9 months ago • 1 comments

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

Image

And this function is not get data

Image

Z-p-github avatar May 04 '25 05:05 Z-p-github

I also encountered a similar problem. On all of Xiaomi's products, it was impossible to obtain the decibel value.

coder-cjl avatar Sep 26 '25 07:09 coder-cjl