expo-audio doesn't record the voice message - Stack Overflow

I am making an app with Expo to record voice messages and I am using the newer version expo-audio to he

I am making an app with Expo to record voice messages and I am using the newer version expo-audio to help with this. I basically follow the code in the expo document but it doesn't want to work...

  const startRecording = async () => {
    await audioRecorder.prepareToRecordAsync();
    audioRecorder.record();
    setRecording(audioRecorder.isRecording);
  };

  const stopRecording = async () => {
    await audioRecorder.stop();
    setRecording(audioRecorder.isRecording);
    setAudioUri(audioRecorder.uri ?? "");
  };

From the code snippet above, the audioRecorder.isRecording is false which I expect to be true since it should be recording... And because it's not recording, the audioRecorder.stop() throws an exception:

[Error: Call to function 'AudioRecorder.stop' has been rejected.
→ Caused by: java.lang.IllegalStateException]

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745063286a4609099.html

相关推荐

  • expo-audio doesn't record the voice message - Stack Overflow

    I am making an app with Expo to record voice messages and I am using the newer version expo-audio to he

    22小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信