如何在颤振中录制标准质量的音频?

时间:2019-06-03 08:57:57

标签: flutter

我想以标准的44100 Hz采样率以.wav格式录制音频,但可用的软件包仅允许采样率非常低的.m4a和.acc

我使用了颤振记录和颤振声音,但都不满足要求

_start() async {
  try {
    if (await AudioRecorder.hasPermissions) {
      await AudioRecorder.start();
      bool isRecording = await AudioRecorder.isRecording;
      setState(() {
        _recording = new Recording(duration: new Duration(), path: "");
        _isRecording = isRecording;
      });
    } else {
      Scaffold.of(context).showSnackBar(
          new SnackBar(content: new Text("You must accept permissions")));
    }
  } catch (e) {
    print(e);
  }
}

_stop() async {
  try{
    var recording = await AudioRecorder.stop();
    print("Stop recording: ${recording.path}");
    bool isRecording = await AudioRecorder.isRecording;
    File file = widget.localFileSystem.file(recording.path);
    voice = convert.base64Encode(file.readAsBytesSync());
    setState(() {
      _recording = recording;
      _isRecording = isRecording;
    });
  } catch(e){
    print(e);
  }
}

我无法指定android中可用的格式

0 个答案:

没有答案