Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Properly inject new params into SDP to get stereo back on Chrome (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 27, 2023
1 parent af6fc4b commit 333c5fb
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,13 @@ export class PeerConnectionController {
* @returns A modified Session Descriptor
*/
mungeSDP(sdp: string, useMic: boolean) {
const mungedSDP = sdp;
mungedSDP.replace(
let mungedSDP = sdp.replace(
/(a=fmtp:\d+ .*level-asymmetry-allowed=.*)\r\n/gm,
'$1;x-google-start-bitrate=10000;x-google-max-bitrate=100000\r\n'
);

let audioSDP = '';

// set max bitrate to highest bitrate Opus supports
audioSDP += 'maxaveragebitrate=510000;';
let audioSDP = 'maxaveragebitrate=510000;';

if (useMic) {
// set the max capture rate to 48khz (so we can send high quality audio from mic)
Expand All @@ -232,7 +229,7 @@ export class PeerConnectionController {
audioSDP += 'useinbandfec=1';

// We use the line 'useinbandfec=1' (which Opus uses) to set our Opus specific audio parameters.
mungedSDP.replace('useinbandfec=1', audioSDP);
mungedSDP = mungedSDP.replace('useinbandfec=1', audioSDP);

return mungedSDP;
}
Expand Down

0 comments on commit 333c5fb

Please sign in to comment.