Hi all!
I have a small sound clip to play again and again, and it suddenly does not work. I did upgraded to Expo 46, but even when I fall back to 45, the error still persists:
- load sound in a Context that wrap App.js
const [sound, setSound] = React.useState();
// preload sound
useEffect(() => {
const loadSound = async () => {
const { sound } = await Audio.Sound.createAsync(
require("../../assets/sounds/countDownSound.mp3")
);
setSound(sound);
console.log("Loading Sound in IAP: ", sound);
};
loadSound().catch((e) => console.log("Load sound error: ", e));
}, []);
And in the file that need to execute:
useEffect(() => {
const play = async () => {
await sound.replayAsync();
console.log("Play Sound");
};
if (seconds === 3) {
play().catch((error) => console.error("error in Play", error));
}
}, [seconds]);
The error is: Error: java.lang.IllegalStateException: Content of this type is unsupported at the
moment. Unsupported type: 4
Did not find much information about this error. Any ideas what is wrong? Thanks a lot!