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

280
Views
How do i record audio from the speakers output using Javascript?

I could not find any answer yet to my question after hours. I've been able recording from microphone only. What i want is, Recording from the speakers (Internal). The idea is a virtual piano which i recently working on it, And users should be able to record what they play.

Here is my code:

const record = ()=> {

  console.log('recording started...')

  navigator.mediaDevices.getUserMedia({audio:true}).then( stream => {

      const MEDIA_RECORDER = new MediaRecorder(stream);
      MEDIA_RECORDER.start();

      const AUDIO_CHUNKS = [];

      MEDIA_RECORDER.addEventListener('dataavailable',e => {
        AUDIO_CHUNKS.push(e.data);
      })

      MEDIA_RECORDER.addEventListener('stop',() =>
      {
        const AUDIO_BLOB = new Blob(AUDIO_CHUNKS);
        const AUDIO_URL  = URL.createObjectURL(AUDIO_BLOB);
        const AUDIO = new Audio(AUDIO_URL);
        
        AUDIO.play();
        
      })
      setTimeout(()=>{
        MEDIA_RECORDER.stop();
        alert('Recording done!')
      },3000)
    })
}

Any idea how to accomplish it? Any answer is appreciated.

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!