:beetle: Description
I'm trying to call seek() after the sound is fully loaded from a remote file in a url. But it seems like the audio is played before the download is finished. so sometimes after seeking to a point the sudio stops and gets stuck like that forever.
:beetle: What have you tried?
I tried using both the callback and isLoaded(). They are both the same
:beetle: Please post your code:
Sound.setCategory('Playback');
this.whoosh = new Sound('https://' + url, null, (error) => {
this.setState({ track: this.whoosh });
if (error) {
console.log(url)
console.log('failed to load the sound', error);
return;
}
// loaded successfully
console.log('duration in seconds: ' + this.whoosh.getDuration() + 'number of channels: ' + this.whoosh.getNumberOfChannels());
// Play the sound with an onEnd callback
if (self.state.allowPlay && this.whoosh) {
this.whoosh.play((success) => {
if (success) {
console.log('successfully finished playing');
} else {
console.log('playback failed due to audio decoding errors');
}
});
}
});
seek = (time) => {
this.whoosh.setCurrentTime(time);
}
:beetle: Description I'm trying to call seek() after the sound is fully loaded from a remote file in a url. But it seems like the audio is played before the download is finished. so sometimes after seeking to a point the sudio stops and gets stuck like that forever.
:beetle: What have you tried?
I tried using both the callback and isLoaded(). They are both the same
:beetle: Please post your code:
:bulb: Possible solution
Is your issue with...
Are you using...
react-native run-android
)Which versions are you using?
Does the problem occur on...
If your problem is happening on a device, which device?