# Possible to get length of audio file?

**URL:** <https://community.thunkable.com/t/possible-to-get-length-of-audio-file/1399139>\
**Category:** Questions about Thunkable X\
**Created:** [July 16, 2021, 10:34am UTC](https://community.thunkable.com/t/possible-to-get-length-of-audio-file/1399139 "2021-07-16T10:34:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![overturner](https://avatars.discourse-cdn.com/v4/letter/o/53a042/32.png) [@overturner](https://community.thunkable.com/u/overturner)\
**Post date:** [July 16, 2021, 10:34am UTC](https://community.thunkable.com/t/possible-to-get-length-of-audio-file/1399139/1 "2021-07-16T10:34:26Z")

</div>

Hi , is it possible to get the length of an audio file(in minutes)  
I want this to make a progress bar

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [July 16, 2021, 12:26pm UTC](https://community.thunkable.com/t/possible-to-get-length-of-audio-file/1399139/2 "2021-07-16T12:26:36Z")

</div>

Only by JavaScript

---

<div class="post-metadata">

**Author:** ![overturner](https://avatars.discourse-cdn.com/v4/letter/o/53a042/32.png) [@overturner](https://community.thunkable.com/u/overturner)\
**Post date:** [July 16, 2021, 12:26pm UTC](https://community.thunkable.com/t/possible-to-get-length-of-audio-file/1399139/3 "2021-07-16T12:26:55Z")

</div>

How should i accomplish this?  
I know java

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [July 16, 2021, 12:33pm UTC](https://community.thunkable.com/t/possible-to-get-length-of-audio-file/1399139/4 "2021-07-16T12:33:12Z")

</div>

Something like this

```auto
var thisAudio = document.getElementById("myAudio");
alert(thisAudio.duration);

```

In .html page it will display the length (in seconds) of the audio file in the tag block having `id=myAudio`

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:19pm UTC](https://community.thunkable.com/t/possible-to-get-length-of-audio-file/1399139/5 "2024-11-08T13:19:45Z")

</div>


