Please provide the following:
- SDK Version: 3.20.1
- Platforms(Android/iOS/web/all): Android
I use the expo-av plugin to record an audio (to later upload it to my backend)
step 1 (I make a new instance of the Recording)
let audio = new Audio.Recording();
step 2 (I prepare the audio object to record)
await audio.prepareToRecordAsync(Audio.RECORDING_OPTIONS_PRESET_HIGH_QUALITY)
step 3 (I start to record)
await audio.startAsync();
step 4 (I get the audio file and log it)
let record = audio.getURI();
console.log(record);
here’s the audio file
file:///data/user/0/host.exp.exponent/cache/ExperienceData/%254027mdmo7sn%252FIndaparty/Audio/recording-37823922-e506-497a-9957-aaeb91d65af5.m4a
step 5 (I create a playback audio file (to listen my record))
const { sound: soundObject, status } = await Audio.Sound.createAsync(
{ localUri : record },
{ shouldPlay: true }
);
in step 5 , I get this error
[Unhandled promise rejection: Error: Cannot load an AV asset from a null playback source]
I’m not sure what’s wrong in my code (how I have a returned path and it’s also considered as null) ?