third_party/blink/manual_tests/audio_latency.html
This page is meant to serve as an example of how to use "audio.latency" tracing to measure internal audio latency. The "audio.latency" category enables code which listens for jumps in amplitude (volume) and starts or stops tracing. We start tracing right after receiving loud audio from a microphone, and stop right before sending that loud audio to speakers. The duration of the trace event (which should show up as an "AmplitudePeak" in the tracing tools) encompases the total internal latency.
Instructions:
Note: The "audio.latency" category only expects one input and one output. Multiple IOs will result in incoherent traces. Additionally, tracing *must* be started before starting the test, or no traces will be captured. Refreshing the page after starting a trace is also not enough: one must verify that there are no InputStreams or OutputStreams alive, by navigating to the "audio" tab of chrome://media-internals. Closing all tabs and waiting 2-10s should be enough for all outstanding streams to close.
Initialize
Use WebAudioUse HTMLAudioElement