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

233
Views
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
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!