Please provide the following:
- SDK Version: 35
- Platforms(Android/iOS/web/all): all
I’ve been trying to get the recording to work. I’m testing on a physical android device.
I’ve even pulled most of the code directly from the docs, here’s what I have:
const [recording, setRecording] = useState(new Audio.Recording());
const handleRecordAudio = async () => {
console.log("entered!");
recording.setOnRecordingStatusUpdate(status =>
console.log("status", status)
);
try {
await recording.prepareToRecordAsync(Audio.RECORDING_OPTIONS_PRESET_HIGH_QUALITY)
await recording.startAsync()
// You are now recording!
} catch (error) {
console.log("error caught!", error);
}
}
And this renders the following output:
entered!
status Object {
"canRecord": false,
"durationMillis": 0,
"isDoneRecording": false,
"isRecording": false,
}
status Object {
"canRecord": true,
"durationMillis": 0,
"isRecording": false,
}
status Object {
"canRecord": true,
"durationMillis": 0,
"isRecording": false,
}
error caught! [Error: Start encountered an error: recording not started]
What am I doing wrong here?