That has removed comfort noise from audio and disabled audio processing
const removeComfortNoiseFromSdp = (sdp: sdpTransform.SessionDescription): sdpTransform.SessionDescription => {
const audioMedias = sdp.media.filter(m => m.type === 'audio')
const audioMedia = audioMedias[0]
if (!audioMedia) {
return sdp // no audio media
}
const whitelistedRtps = audioMedia.rtp.filter(rtp => {
const codec = `${rtp.codec}`.toLowerCase()
return codec !== 'cn'
})
const whitelistedPayloads = whitelistedRtps.map(rtp => rtp.payload)
audioMedia.rtp = whitelistedRtps
audioMedia.payloads = whitelistedPayloads.join(' ')
audioMedia.fmtp = audioMedia.fmtp.map(fmtp => {
return {
...fmtp,
config: `${fmtp.config}`.replace('useinbandfec=1;', 'useinbandfec=1; stereo=1; maxaveragebitrate=510000'),
}
})
return sdp
}