# Exposing currentTime of a sound object. Tried using the \_startTime, \_startOffset and engine's current time but some issues

**URL:** <https://forum.babylonjs.com/t/exposing-currenttime-of-a-sound-object-tried-using-the-starttime-startoffset-and-engines-current-time-but-some-issues/14649>\
**Category:** Questions\
**Created:** [October 4, 2020, 4:26pm UTC](https://forum.babylonjs.com/t/exposing-currenttime-of-a-sound-object-tried-using-the-starttime-startoffset-and-engines-current-time-but-some-issues/14649 "2020-10-04T16:26:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jocravio](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jocravio/32/9357_2.png) [@jocravio](https://forum.babylonjs.com/u/jocravio)\
**Post date:** [October 4, 2020, 4:26pm UTC](https://forum.babylonjs.com/t/exposing-currenttime-of-a-sound-object-tried-using-the-starttime-startoffset-and-engines-current-time-but-some-issues/14649/1 "2020-10-04T16:26:34Z")

</div>

Hey, I wanted to ask if it is possible to expose the `currentTime` of a Sound object. I read an advice that was provided before to use the `startTime`, with the `startOffset` and the engine’s current time to calculate it, at that is not fully working as expected.

Here is my code:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/b/bb68d37bea5c1b139665baa518258e344159ff30.png)

This works fine most of the time. However, when a sounds runs all the way to its end, when you replay the sound, the `startOffset` doesn’t go back to zero, and I start getting none expected `currentTime`s. I could listen to the end event on my side, but I think this is becoming a bit too hacky.

Would it be possible for this be calculated on Babylon’s side as it is a common property on media?

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [October 4, 2020, 5:14pm UTC](https://forum.babylonjs.com/t/exposing-currenttime-of-a-sound-object-tried-using-the-starttime-startoffset-and-engines-current-time-but-some-issues/14649/2 "2020-10-04T17:14:53Z")

</div>

sure thing! wanna do a PR?

---

<div class="post-metadata">

**Author:** ![jocravio](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jocravio/32/9357_2.png) [@jocravio](https://forum.babylonjs.com/u/jocravio)\
**Post date:** [October 12, 2020, 7:55pm UTC](https://forum.babylonjs.com/t/exposing-currenttime-of-a-sound-object-tried-using-the-starttime-startoffset-and-engines-current-time-but-some-issues/14649/3 "2020-10-12T19:55:09Z")

</div>

Sure, here it is:

> <https://github.com/BabylonJS/Babylon.js/pull/9158>

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [October 12, 2020, 8:00pm UTC](https://forum.babylonjs.com/t/exposing-currenttime-of-a-sound-object-tried-using-the-starttime-startoffset-and-engines-current-time-but-some-issues/14649/4 "2020-10-12T20:00:14Z")

</div>

I’m waiting for the checks to finish and I will gladly merge  
Thanks a lot
