Sub-sample accurate start for ABSN #13061
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement sub-sample accurate start for AudioBufferSourceNode.
Previously, if the start time was between sample boundaries, we would
start the output at the frame before the start time. This is actually
incorrect because we haven't actually started yet. We should start
the output at the next boundary, and interpolating the value based on
the true start time and the sample boundary.
Many tests needed to be updated. Basically for each test that needed
to be changed, the sample rate is set to a power of two and all ABSN
sources are updated to make sure the source starts exactly on a frame
boundary. We also took the opportunity to adjust the error thresholds
for the tests in case lower values could be used.
Some additional notes for the tests:
audiobuffersource-playbackrate-zero.html: Add new test to make sure
sub-sample accurate start handles a zero playback rate.
audiobuffersource-loop-points.html: add some code to save the actual
output. This is needed because a new reference file is needed since
the sample rate has changed.
Also manually tested all of the modified tests with Firefox nightly.
They all pass still (except for the new sub-sample test because
Firefox doesn't do sub-sample accurate start/stop).
Bug: 876917
Test: the-audiobuffersourcenode-interface/sub-sample-scheduling.html
Change-Id: Ib13ba30eaa160cfd10739feabac961bf074ee309
Reviewed-on: https://chromium-review.googlesource.com/c/1212270
Commit-Queue: Raymond Toy <rtoy@chromium.org>
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626753}