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
Playout Statistics API for WebAudio #142
Comments
CC: @hoch. |
Can we consider renaming this subgroup of API to: Playout Statistics API for WebAudio |
palak8669
changed the title
AudioContext Glitch & delay metrics API
Playout Statistics API for WebAudio
Mar 5, 2024
Draft spec: https://palak8669.github.io/web_audio_playout/ |
Zoom is interested in this API for the purpose of detecting audio glitches 👍 |
Sounds good. @palak8669 , if you want to transfer the repo to me I can transfer it into the WICG org. |
Transferred to https://github.com/WICG/web_audio_playout. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Introduction
When playing audio through WebAudio, we want to be able to measure the delay of that audio and the glitchiness of the audio. This document contains a proposal of an API that would allow WebAudio users to do this.
Use Cases
There is currently no way to detect whether WebAudio playout has glitches (gaps in the played audio, which typically happens due to underperformance in the audio pipeline). There is an existing way to measure the instantaneous playout latency using AudioContext.outputLatency, but no simple way to measure average/minimum/maximum latency over time.
Glitches and high latency are bad for the user experience, so if any of these occur it can be useful for the application to be able to detect this and possibly take some action to improve the playout.
Goals
We want to be able to calculate the following things:
Proposed Solution
We can do this by adding a new attribute to AudioContext interface, AudioPlayoutStats. This new interface AudioPlayoutStats, defines multiple metrics to measure the glitches and latency in the audio playout.
Examples
Privacy & Security Considerations
Exposed information
This API includes stats about dropped frames and latency.
Dropped frame counters
This concerns the following attributes:
fallbackFramesEvents is needed to calculate the number of glitches and fallbackFramesDuration calculates the duration of lost audio due to such glitches. This information is needed to evaluate the quality of audio streams played through WebAudio.
Latency
This concerns the following attributes:
The instantaneous latency is already available through the AudioContext.outputLatency property. This new API adds the ability to get the minimum, maximum and average outputLatency over a time interval. It is theoretically already possible to calculate these stats through JavaScript, but it would be less efficient and user friendly.
Fingerprinting
Let’s Discuss
We are looking for feedback on our proposal and improving it by looking for other possible solution alternatives for the use case. We would also like to hear from people who would be interested in using this API to gauge interest.
The text was updated successfully, but these errors were encountered: