You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
buffer-resampling.html (WPT test) fails because we interpolate the last sample with 0 when we output a sample with pos corresponding to buffer.len() - 1 < pos < buffer.len(). For playhead positions after the last sample, Chromium implemented linear extrapolation using the last two samples, and this seems to be needed to pass this test using a linear interpolation strategy (Firefox uses truncated sinc interpolation via libspeex-resample). The relevant code is
let next_sample = *self.buffers[chan asusize].get(prev + 1).unwrap_or(&0.0);
Chromium does not support negative playbackRates, as far as I can tell, but in this case we would likely want to do an analogous extrapolation for playhead positions that are slightly before the first buffer sample.
The text was updated successfully, but these errors were encountered:
We should fix the code to match the test here, usually such bugs (when WPT disagrees with the spec) are spec bugs, and it makes sense for that to be the case here.
collares
changed the title
AudioBufferSourceNode: Decide if we should interpolate with silence after last sample
AudioBufferSourceNode: Implement linear extrapolation for endpoints
Sep 22, 2019
buffer-resampling.html (WPT test) fails because we interpolate the last sample with 0 when we output a sample with pos corresponding to buffer.len() - 1 < pos < buffer.len(). For playhead positions after the last sample, Chromium implemented linear extrapolation using the last two samples, and this seems to be needed to pass this test using a linear interpolation strategy (Firefox uses truncated sinc interpolation via libspeex-resample). The relevant code is
media/audio/buffer_source_node.rs
Line 399 in 86b9a28
Chromium does not support negative playbackRates, as far as I can tell, but in this case we would likely want to do an analogous extrapolation for playhead positions that are slightly before the first buffer sample.
The text was updated successfully, but these errors were encountered: