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

173
Vistas
WebRTC Force Stereo in Chrome by editing the sdp config

I'm trying to implement a workaround for what appears to be a known issue in all browsers but firefox where webRTC audio stream is downgraded to mono from stereo.

This seems to happen due to the local session description defaulting to stereo=0 in the negotiated sdp config file which is produced based on the stream's constraints.

I have included the following constraints:

    audio: { deviceId: audioSource ? { exact: audioSource } : undefined,
      channelCount:2, 
      echoCancellation: false, // disabling audio processing
      googAutoGainControl: false,
      googNoiseSuppression: false,
      googHighpassFilter: false
    },

and then I attempt to append the required fix to the sdp file before setting local description using a process called SDP munging https://webrtcglossary.com/sdp-munging/:

  peerConnection
    .createOffer({ offerToReceiveAudio: true, offerToReceiveVideo: false })
    .then( desc => desc.sdp=desc.sdp.replace('useinbandfec=1','useinbandfec=1; stereo=1'))
    .then(desc => peerConnection.setLocalDescription(desc))
    .then(() => socket.emit("offer", id, peerConnection.localDescription));

the error I receive :

broadcast.js:53 Uncaught (in promise) TypeError: Failed to execute 'setLocalDescription' on 'RTCPeerConnection': The provided value is not of type 'RTCSessionDescriptionInit'.

This fix was recommended by a number of sources on this topic but any time I attempt to modify the file prior to setting the local description I get a type error that it is no longer an RTCSessionDescription

I am hoping I am performing the SDP munging incorrectly and that there is a better way to go about this

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