-
Notifications
You must be signed in to change notification settings - Fork 46
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 stat for inputAudioLevel, before the audio filter #271
Comments
Doodling: This would logically be a stat on the source for a track, not a stat on the track itself, no? if you have: getUserMedia(audio, id=foo, volume=1.0) => track1 and get an input signal at 0.5 (-6dBov) then track2 would get 0.25 (-12dBov) and track1 would get 0.5 as "level"; an input stat would get 0.5 for both. One way of getting "unprocessed volume" would be getUserMedia(audio, id=foo) => track1 track2 should then get the number you want. |
Good point, getting a second track without processing may achieve the same. Presumably at higher cost though. |
from #288: I am trying to see now if we compare the input audio level with the audio output level and the audio output takes the volume into account, how do I diagnose if the issue is with the post decoding filter...? |
An implementation experiment showed that on current Chrome, you can't turn on echo cancellation on one track and turn it off on another track from the same source - which limits the usefulness of my other idea. https://crbug.com/802198 |
Would RTCRtp{Contributing,Synchronization}Source (from webrtc-pc) be an appropriate place for this? It seems like this is data that one might want to poll frequently. |
It took me too long to realize this was about local media. Still, there may be a better API possible (one that is synchronous and fast) than getStats for audio data. |
It turns out present Chrome doesn't support having two tracks from the same source with differing processing requirements. So it makes sense, sort of. |
Thought: One possibility is to define a "source" stats object, which would have a reference from the "track" stats object. This is a place to hang both input audio level and input frame width and height (which has been requested in other contexts - see googFrameWidthInput non-standard stats). |
Note: No matter what, it should be doing "accumulated energy", not "instant volume", for all the reasons given. |
👍 If we can do video input as well, it would be worthwhile consider doing. |
Resolution may change 1-7, we can only provide getStats() for what is in the "WebRTC pipeline", e.g. 3-6. Our current stats are for 3 and for 6 (or if we don't do anything at 6 I then the stats are for 5). Am I missing anything? |
2 and 3 are the same resolution |
I think some of this issue stems from wanting stats before/after application does additional processing, but that is outside the scope of WebRTC pipeline. |
My original concern was to have input and output metrics for all the components that transform media in some way. For example, components of the media pipeline that downscale/upscale video or suppress/conceal audio. |
The sender is comprised of multiple components and it might be worth considering splitting the dictionary up into multiple components to reflect that, a "sender"/"receiver" and "encoder"/"decoder" dictionary. Conceptually: https://photos.app.goo.gl/fyqGKxYMhM247dK47 The encoder should have input/output stats (whether resolution or audio energy, etc). Or we put them in the "sender" stats for now, but be clear about what is input and what is output, none of the names are clear about which step in the pipeline they reflect. But let's make sure this is something we want before we change it. It could be that what is being asked for are metrics for before or after the WebRTC pipeline, which might be outside the scope of this spec. |
Based on discussion with @huibk and @vr000m: This has to do with MediaStreamTrack and getUserMedia()/devices, stats for before and after processing/applying constraints, which is outside of WebRTC (and could be of interest for non-WebRTC applications) and this spec. Closing this bug. Feel free to file a bug on https://github.com/w3c/mediacapture-main/issues. |
It could be useful to have a stat the represents the audio level before noise filtering or gain control. Use cases are:
The text was updated successfully, but these errors were encountered: