Join GitHub today
Add RTCRtpSender.getSynchronizationSources() to expose audioLevel #2103
A lot of people poll getStats() frequently to obtain audio levels, which is supposedly inefficient to the point that it can make your laptop sound like a helicopter. We already have RTCRtpReceiver.getSynchronizationSources()[i].audioLevel, should we add getSynchronizationSources() to RTCRtpSender as well? It would represent the RTP packets sent instead of the ones received, so you can read the local audio levels without setting up a loopback connection.
referenced this issue
Feb 14, 2019
This need should be solved by reading back audio level on a MediaStreamTrack instead. It's more general, and doesn't depend on the vagaries of the particular RTP packetization regime in force.
If we ever get to sending pre-encoded audio streams, supporting sender's audio level would require re-decoding the audio packets in order to read the level; that sounds like an architecturally wrong approach.