-
Notifications
You must be signed in to change notification settings - Fork 11
Does AudioContext.latencyHint affect AudioWorkletProcessor::process Callback Interval? #70
Comments
Different Could not locate language in the current specification that unequivocally states that Is the result working as intended? |
It's not really clear how you compute the callback interval. But the latency value can affect when You might be interested in getOutputTimestamp. See also WebAudio/web-audio-api#12 and related issues. |
It's a hint, by definition it is valid, for example, to implement it and do nothing. This is spelled out. The actual latency must however be reported, but doesn't have to match. it can be absolutely backward and still be compliant: an implementation cannot always control the actual latency, regardless of what is being asked by authors. The timings at which |
Count the number of times There is an observable relationship between the value set at |
Well, that appears to be what is occurring in the only implementation of |
For a set of 10 tests, where the value is the number of
Code to reproduce main.js
processor.js
|
Since you have chosen a sample rate of 44.1 kHz, there should be 44100/128 calls to process, or about 344 calls per sec. If you're not getting this, file a bug against Chrome. BTW, I think your process method is more complicated than it needs to be and generates too much garbage. Just add a counter and increment it each time it's called. Inspect the currentTime and post a message when 1 sec (or 10 sec or whatever) have passed. No garbage generated. Anyway, I think the spec is pretty clear: process gets called about 344 times per sec in this case. They may be bursty, but the average should be that. |
The code originates from a Chromium bug and is only used to demonstrate that @rtoy The point of this issue is that different values set at From the responses to this issue thus far it is not clear that is the intended behaviour. What is clear is that behaviour is not described in Web Audio API specification. Therefore, the issue is not resolved by any definitive answer from contributors to the specification. |
The processing algorithm is described here: https://webaudio.github.io/web-audio-api/#processing-model. The Anyway this issue is closed. You've already filed a bug for Chrome. Further discussions will happen there. I don't think there's any inconsistency in the spec, but the processing algorithm is pretty complicated. |
Describe the issue
Does
AudioContext.latencyHint
affectAudioWorkletProcessor::process
Callback Interval?If so that language and effect is not clearly specified.
Where Is It
Additional Information
At DevTools open WebAudio tab. Observe the values of Callback Interval corresponding to different
AudioContext.latencyHint
settings"playback"
=> Callback Interval 23.217"interactive"
=> Callback Interval 11.626"balanced"
=> Callback Interval 9.90.5
=> Callback Interval 185.729The text was updated successfully, but these errors were encountered: