fix: re-anchor instead of Clear on static-delay change (kills offset-tuning silence)#54
Merged
Merged
Conversation
…tuning silence) Moving the static-delay slider called _audioPipeline.Clear(), which dumps the entire buffer. With a server that transmits far ahead of playback (30-44s), the only audio that refills is future-timestamped, so the buffer waited that whole window in silence on every nudge — making the offset impossible to tune by ear. Swap Clear() for IAudioPipeline.ReanchorTiming(), which forwards to the device-switch-proven TimedAudioBuffer.ResetSyncTracking(): it re-anchors timing (picking up the new StaticDelayMs) while preserving buffered audio, so the delay applies in place with no refill wait. Requires Sendspin.SDK 9.0.5 (adds IAudioPipeline.ReanchorTiming) — lands with that bump. Adds StaticDelayReanchorTests proving ResetSyncTracking preserves the buffer and keeps audio flowing, whereas Clear empties it (silence).
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.
Problem
Adjusting the static-delay slider blanked the audio for tens of seconds on every nudge — making the offset impossible to tune by ear.
OnSettingsStaticDelayMsChangedcalled_audioPipeline.Clear(), which dumps the entire buffer. With a server that transmits far ahead of playback (30–44s observed), the only audio that refills is future-timestamped, so the buffer waits that whole transmit-ahead window in silence before playing again.Fix
Swap
Clear()for the newIAudioPipeline.ReanchorTiming()(Sendspin.SDK 9.0.5, #57 upstream), which forwards to the device-switch-provenTimedAudioBuffer.ResetSyncTracking(). It re-anchors timing — so the next callback re-derives the scheduled start with the newStaticDelayMs— while preserving the buffered audio. The delay applies in place, no refill, no silence.Bumps
Sendspin.SDK9.0.4 → 9.0.5.Tests
StaticDelayReanchorTestsexercises the buffer primitive directly:ResetSyncTracking→ buffer preserved (>1000msretained), audio flows on the next read.Clear→ buffer emptied (<1ms), output silence — the old behavior.Build green, full suite 96/96.
Verify
Merging publishes a dev build: move the offset slider mid-playback — the change should apply immediately with no audio dropout.