Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

136
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda