I am trying to use the Audio
through the code snippets provided in documentation (Audio - Expo Documentation).
componentDidMount() {
this.playSound();
}
async playSound() {
const soundObject = new Audio.Sound();
await soundObject.loadAsync(require('./assets/sounds/hello.mp3'));
soundObject.setPositionAsync(0);
await soundObject.playAsync();
// Your sound is playing!
// NO IT IS NOT PLAYING :-(
}
The simplest possible snack that I tried is here: Audio Test - Snack
The problem is no matter what I do, I can not hear the sound.
Can it be related with the documentation or the expo application or - most possibly - something crucial I am missing?
Thanks in advance…