//PLaying Sound
async function playSound() {
console.log('Loading Sound');
const { sound} = await Audio.Sound.createAsync(route.params.url,
);
setSound(sound);
setsound1(false)
sound.setOnPlaybackStatusUpdate(playback_staus_update)
console.log('Playing Sound');
sound.setPositionAsync(1500)
sound.playAsync()
setsound1(false)
//Playback Status Upadte
var y=0
async function playback_staus_update(){
if(sound!=undefined){
var x=await sound.getStatusAsync()
console.log(x)
if(x.isPlaying){
y++
setcurrentaudposition(x.positionMillis)
}else{
console.log('Audio Stopped!');
if(y>1){
setsound1(true)
}
}
}
}
//Playback Status Upadte
when playSound() is called instead of audio getting played from 1500 ms it starts to play from 0 millisecond enter image description here In start the position is set to 1500 but when the audio starts playing it starts from 0.
Trying to set position of an audio to specific duration using
"await sound.setPositionAsync()" but instead it play from 0 millisecond.