Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RTCRtpSender.getSynchronizationSources() to expose audioLevel #2103

Open
henbos opened this Issue Feb 14, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@henbos
Copy link
Contributor

commented Feb 14, 2019

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.

Related question:

  • Is this audioLevel "good enough" to replace getStats()'s audio level? This is an instantaneous value, and while it can be polled frequently without any significant overhead, it may be based on something other than what people are used to.
@alvestrand

This comment has been minimized.

Copy link
Contributor

commented 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.

@henbos

This comment has been minimized.

Copy link
Contributor Author

commented Feb 14, 2019

Is there a reason why you can't simply do MediaStreamTrack.getSettings().audioLevel or MediaStreamTrack.audioLevel, or MediaStreamTrack.totalAudioEnergy, etc? I remember talking about this years ago, but kept getting referred to WebAudio...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.