Hi, I am trying to pause/resume and audio track but when I resume the audio track it resumes from the wrong position. It is as if the pause didn’t actually pause it, but just turned the volume down.
and later I do…
Additionally, when I try to manually force the current audio time using something like:
this.entity.sound.currentTime = 30.0;
Confirmed it is a bug: Unpausing a sound that is paused does not resume at the time it is paused · Issue #5240 · playcanvas/engine · GitHub
The sound component doesn’t have a
currentTime property: SoundComponent | PlayCanvas API Reference
The Sound Slots do though: SoundSlot | PlayCanvas API Reference
Great. Good to know I wasnt going crazy.
Regarding the Soundslot.currentTime. How exactly do I set this? What is the correct syntax? It doesnt really say in the help document.
this.entity.sound.slot("Slot 1").currentTime= 30.0;
SoundSlot doesn’t have
currentTime property. Sound Instance does.
Oh, my bad. I got confused by
startTime on the sound slot
If you desperately need it now, I’ve created a patch that can be added to a project: https://playcanvas.com/project/1062026/overview/f-pause-sound
sound-resume-patch.js. Make sure that Loading Type is
This has been fixed in engine release 1.62.1 that is now in the Editor