Check if sound has been played completely

what is the correct way to know that a particulate sound slot with a name say, “slot1” has been played once. I am looking for a equivalent of currentTime in animation. After going through the documentation, I found soundInstance gives me one such parameter, but I am not sure how to access it.

A reference to a project may help as well.

Thanks.

When you play a sound slot via the sound component, it returns a soundInstance https://developer.playcanvas.com/en/api/pc.SoundComponent.html#play

You can then use the the soundInstance to compare the currentTime to the duration to determine if the sound has been completely played.

Thanks a lot. It worked.