Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

174
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda