Please provide the following:
- SDK Version: ^47.0.13
- Platforms(Android/iOS/web/all): iOS and Android
- Add the appropriate “Tag” based on what Expo library you have a question on.
expo-av
I can successfully record files in wav, ma4 and caf format but when I try to play them back, I get an error that says format not supported. Here is my code to play back the audio files.
useEffect(() => {
const playAudio = async () => {
const signedUrl = await getAudioSignedUrl(moodId,uri,‘audio’)
console.log(AUDIO URL: ${signedUrl}
)
await Audio.requestPermissionsAsync();
await Audio.setAudioModeAsync({
staysActiveInBackground: false,
shouldDuckAndroid: false,
playThroughEarpieceAndroid: false,
allowsRecordingIOS: false,
playsInSilentModeIOS: true,
});
const { sound } = await Audio.Sound.createAsync({ uri: signedUrl },{shouldPlay: true});
sound.setOnPlaybackStatusUpdate((status) => {
if (status.didJustFinish) {
sound.unloadAsync();
}
});
await sound.playAsync();
return () => {
sound.unloadAsync();
};
};
playAudio();
}, );
I have searched StackOverflow but those suggestions did not help. Any ideas?