Repository navigation
Description
AudioSinkType none is currently defined as:
The audio graph will be processed without being played through an audio output device.
The following excerpt suggests that an AudioContext requires a system-level audio callback (is this an audio output device?):
The AudioContext rendering thread is driven by a system-level audio callback, that is periodically called at regular intevals.
Both definitions of underrun also seem to assume an output device:
audio buffer underrunis defined from theload value of a system-level audio callback.- an
underrun frameisan audio frame played by the output device that was not provided by the AudioContext.AudioPlaybackStatsis built on this definition.
With a none sink, there is no system-level audio callback, so it is unclear what drives rendering.
This matters when the context generates data for an audio MediaStreamTrack through a MediaStreamAudioDestinationNode. That track can be consumed by an RTCPeerConnection, a MediaRecorder, a media element, or another AudioContext through a MediaStreamAudioSourceNode. Each consumer expects audio paced in real time, so what the context produces needs to be well defined.
It would be good to clarify:
- What the clock source of a
nonecontext is. Is it real-time paced at sampleRate? - What happens when rendering is late, e.g. when an AudioWorklet takes longer than its real-time budget for a render quantum:
- Are the missed render quanta rendered later to catch up, so no samples are lost but the output arrives late and in a burst?
- Or are they dropped, so the output has gaps?
- How should the audio delivered to the MediaStreamTrack be timed in either case?
- What playbackStats reports for a
nonecontext.
We should also write WPT tests once we understand what the expected behavior is (something like RTCPeerConnection/MediaRecorder/AudioContext processing data from a none AudioWorklet).
https://w3c.github.io/mediacapture-extensions/#dom-mediastreamtrackaudiostats is probably also testable on its own. I had a quick look in https://github.com/web-platform-tests/wpt/tree/master/webaudio but did not find much.
FWIW, this issue is also describing the questions I had w.r.t. the AudioTrackGenerator API that Chrome already shipped. If we answer them for none sink ID, this would probably answer them for AudioTrackGenerator as well.
CC @guidou, @jan-ivar.
Activity
padenot commentedon Nov 3, 2026
Real-time, otherwise you cannot implement the spec, but not "paced at sampleRate". It's paced however you want, as long as you can make it work, e.g. it will be driven by a system clock. This will drift against audio clocks and it needs to work without glitching/dropping audio, the same way two
AudioContextfrom different devices don't share a clock but need to work well together.The first point, like it does today for real-time
AudioContextattached to an audio device, it catches up or shifts phase. This is how audio software usually work, we don't skip an iteration, as it would break a lot of things. If dropping/resampling any correction need to happen, it happens at boundaries, as it does today, and implementation can compete on what the best way to do this is, we know not all of them do it the same way, e.g. between anAudioContextand theMediaStreamTrackcoming fromgUMmicrophone.MediaStreamTrackunder-running when the consumer is real-time is opaque (asMediaStreamTrackshould be).Precisely the same no? You have the same block duration, render duration, etc.