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

176
Views
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
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!