Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
How to manage time of audio in html?
<script>
let mySong = new 
Audio("_Dard_Dilo_Ke_Full_Song_(Audio)__Himesh_Reshammiya,_Yo_Yo_Honey_Singh(128k).m4a");
console.log((mySong.duration)/60);
</script>

This song is of 4.24 minutes but when i console log the the same song's duration is shows 4.40 minutes . How to deal with this

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Not sure why you are dividing it by 60 (you want to convert it to minutes). There is no need to. You simply can get the duration by this

`var obj = document.createElement('video');
  console.log(obj.duration); `

Or if you want to update the time:

    duration = parseInt( audio.duration ),
    currentTime = parseInt( audio.currentTime ),
    timeLeft = duration - currentTime,

You can convert it to minutes and second like this one:

   second = timeLeft % 60;
   mintues = Math.floor( timeLeft / 60 ) % 60;
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!