React-native-sound: playback failed due to audio decoding errors

Created on 10 Oct 2017  Â·  6Comments  Â·  Source: zmxv/react-native-sound

Every time playing audio ,
image
success is always false

Most helpful comment

move it to inside "new Sound"

All 6 comments

have already been solved

@jYh1014 how?

move it to inside "new Sound"

playback failed due to audio decoding errors

I am having issue

Move the pay action into the success part of loading the sound file like so

var sound = new Sound(require('./sound.mp3'), (error) => { if (error) { console.log('failed to load the sound', error); return; } // loaded successfully sound.play((success) => { if (success) { console.log('successfully finished playing'); } else { console.log('playback failed due to audio decoding errors'); sound.release(); } }); });

Was this page helpful?
0 / 5 - 0 ratings