I am using howler.js to manage sounds within my html/css/js project, everything is working fine, the only point that took me hours of research without success is: How can I get the length of a sound using howler.js methods?
I am using howler.js to manage sounds within my html/css/js project, everything is working fine, the only point that took me hours of research without success is: How can I get the length of a sound using howler.js methods?
Share Improve this question edited Jul 3, 2014 at 9:57 crazyosachou asked Jul 2, 2014 at 18:42 crazyosachoucrazyosachou 591 silver badge6 bronze badges2 Answers
Reset to default 9Using howler.js, you can simply do the following:
sound._duration
You may also want to wrap that inside of the onload event as you won't be able to get the duration until the sound has loaded.
Without any library I would reend using .duration
property of your audio element. which returns the amount of seconds that the audio should play.