Skip to content

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

Open
@Z-p-github

Description

@Z-p-github

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions