Audio recorder: "Prepare encountered an error: recorder not prepared"


#1

I started a simple audio recording app using the Expo Audio app, and as far as I can tell I’m doing the right thing with Recorder, but I get the error “Prepare encountered an error: recorder not prepared”

This is confusing because I would assume trying to prepare a recorder would not need an already-prepared recorder, and even more troubling, there are no google results for it other than the code listings: https://www.google.nl/search?client=safari&rls=en&q=expo+"recorder+not+prepared"&ie=UTF-8&oe=UTF-8&gfe_rd=cr&ei=l9eZWb_GBo3SXoXrpIgL

Here’s my code: https://github.com/thedaniel/sexy-priest

To reproduce the error, load the app and click “confess”

I am running it through the expo app on an iPhone 7.


#2

this is example how you can recorder whit Expo Audion API (https://github.com/expo/audio-recording-example)


#3

I deduced the problem from the sample code and figured out why I went wrong. The docs for Expo.Audio in the docs site didn’t make it clear that Audio.setAudioModeAsync MUST be called.