Audio: Fixed time-stretched clips reading a stretcher-latency's worth of audio behind their play position - #404
Open
drowaudio wants to merge 1 commit into
Open
Conversation
… of audio behind their play position, by discarding the warm-up frames as well as the latency region when priming Only stretchers that report a latency (currently Signalsmith) go through primeStretcher(). It backed the source up by the latency to warm the stretcher with real audio but then only discarded the latency region of output, so the next delivered frame was a full latency behind readPosition. This showed up as launcher clips with a source offset starting ~150ms early and looped clips glitching at each wrap. Adds a WaveNode test that checks each enabled stretcher lines the source up with the timeline at a non-zero clip offset, through both the normal and read-ahead readers.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #404 +/- ##
===========================================
+ Coverage 58.69% 58.91% +0.21%
===========================================
Files 562 562
Lines 78793 78842 +49
Branches 12325 12330 +5
===========================================
+ Hits 46250 46450 +200
+ Misses 32543 32392 -151 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
primeStretcher()intracktion_WaveNode.cppbacked the source up by the stretcher's latency to warm it with real audio, but then only discarded the latency region of output. The next delivered frame was therefore a full latency behindreadPosition. Fixed in bothTimeStretchReaderandReadAheadTimeStretchReaderby discarding the warm-up frames as well as the latency region, and clamping the read-ahead version's final pop so it can't over-discard.ClipLauncher.test.cppcases ("launch with clip source offset" and "switching scenes moves all tracks to the new scene") fail in builds without RubberBand.Testing
runTimestretchedTests()intracktion_WaveNode.test.cpp: a source with a silent middle second, played at clip offsets 0 and 1s, over every enabled stretch mode and both read-ahead settings. Fails without the fix (signalsmith only), passes with it. Because it iterates over enabled modes rather than the default, it exercises Signalsmith on CI too.Notes