Pausing and playing an audio with offset restarts it from the beginning instead of the current position

I’m adding playgrounds for manual testing right now.

I have a fix and refactor for the pause functionality, but I want to make sure I’m not breaking something else before posting it.

PR #13455 fixes this (hopefully without breaking anything else).

Repeated posts are fine by me. I appreciate you reporting these issues. Thanks for your patience and keep 'em coming if you find more!

3 Likes

@docEdub Thank you for the fixes ! But I suspect a new unexpected behavior crept in :upside_down_face:. Now, sound.onEndedObservable() is being called everytime the audio is paused. Is this expected ?

PG:

Yep, fixed in PR #13472!

1 Like

Quick as always ! In the pre-fix 5.44.0 version, there was another issue where the currentTime sometime became greater than the total audio duration. I have created a new thread for that because the repro steps seemed a bit involved. Can you please tell if that would be something you can check ?

Thread: Sound currentTime exceeds total duration in some cases

Thanks a lot, again, for the rapid fixes!

Good find! Fixed in PR #13478.

1 Like

I’m curious what you’re use-case is that the loop option doesn’t work for it.

We’re working on sort of a 3D media player. To be honest, I might be able to make it work with the loop option, but the code is spread across multiple files and deals with hundreds of views and audio objects with a messy React state management. So, I just avoid touching the working parts and only keep fixing the bugs at the edges :slight_smile:

1 Like