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

122
Vistas
WebRTC to stream new Audio

I'm building a web application, where music/audio is playing from an object using new Audio(). On another tab I'd like to listen to the music through WebRTC. I already have the WebRTC established, and I can confirm it works with microphones on both sides.
When I try to change the "music" tab's microphone to a mediastream of a "new Audio()", it no longer works and the listeners-tab is silent.

I'm trying it like this:

audio = new Audio();
audio.src = someArray['audiosrc'];
mediaStream = audio.captureStream()
audio.play();
webRTC.addTrack(mediaStreams.getAudioTracks()[0]);

I have no clue why the listeners-tab is completely silent... Is there anything wrong with the code? I don't see any errors in the console, I don't see any errors on the receiving side, but it still does not want to "stream" the audio.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

When you already have a WebRTC connection established and you want to add a new track to it, renegotiation needs to be done so the browser knows how to encode the track.

Renegotiation is pretty much creating an SDP offer and receiving an answer just like during the first connection setup.

See the note on top of the page: https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addTrack

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