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

236
Vistas
Failed to stop the timer for audio when clicked on Pause button using Recorder.js

I have successfully added a timer to the audio recorder but failed to stop when clicked on the pause button.

I am using the example mentioned below.

  • Blog Post - https://blog.addpipe.com/using-recorder-js-to-capture-wav-audio-in-your-html5-web-site/
  • Original Source code - https://github.com/addpipe/simple-recorderjs-demo
  • Working Example Link - https://addpipe.com/simple-recorderjs-demo/

I have modified the HTML and JS.

HTML

<div class="audio-input-area">

    <div id="controls">
        <button id="recordButton">Record</button>
        <button id="pauseButton" disabled>Pause</button>
        <button id="stopButton" disabled>Stop</button>
    </div>
    

    <!--- Added .status-text paragraph for timer --->

    <p id="status-text"></p> 
   
    <div id="recordingsList"></div>
    
</div>

JS

navigator.mediaDevices.getUserMedia(constraints).then(function(stream) {

    ................Existing code..................
    .................Existing code.....................
    

    // Added the code below for the timer

    intervalId = window.setInterval(function(){
        
        floatValue = Math.floor( audioContext.getOutputTimestamp(stream).contextTime )
        statusText.innerText = secondsToHms(floatValue);

        // console.log(secondsToHms(floatValue));
        // console.log(audioContext.currentTime);
        /// call your function here
        // console.log(audioContext.getOutputTimestamp(stream))
        // console.log(floatValue);
        
    }, 1000);
    
    
    ..............Existing code....................
    ................Existing code......................
}
about 4 years ago · Juan Pablo Isaza
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