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

283
Vistas
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
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