Repository navigation
Conversation
…er-of-two one) A movie picture decoded as a texture is rounded up to powers of two: a 640 x 448 picture in a 1024 x 512 texture. setBackdrop mapped the whole texture to its rectangle, so a port had to draw it larger than the picture and let the window cut the padding off. Where the window does not (a 4:3 picture kept 4:3 in a widescreen frame, or a letterbox), the padding showed: Amplitude's widescreen movies had a strip of stale pictures at the right and below. Two trailing parameters (u, v) give the part that is the picture; their defaults (1, 1) keep every port's call as it was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
holdToHostTime cut a frame's surplus samples whenever the frame made more than the host's time allowed plus a quarter field. A window whose frames run a hair off the sound card's clock (the game's steady 800 samples a frame against a budget slightly short) lost 1 to 16 samples every few frames, each cut a click: Amplitude's tutorial narration crackled (826 cuts in two and a half minutes). - A small surplus (up to 5 % of the frame: drift and jitter) is now resampled into what is allowed, the frame's first and last samples kept, a pitch change too small to hear. - A larger one (a leap: a disc wait the PC did not live) is cut as before, the newest samples kept, but the join is cross-faded over up to 64 samples. Measured on the tutorial's output (SDL's dummy audio driver, the window's WAV): as many clicks as the game's own mix (446 against 444 in 80 s). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Stacked on #163. The new commit is 30013e4.
What
FreeHost::holdToHostTimeused to cut a frame's surplus samples whenever the frame made more sound than the host's time allowed (plus a quarter field). Now:Why
A window whose frames run a hair off the sound card's clock makes a steady 800 samples a frame against a budget slightly short. It lost 1 to 16 samples every few frames, and each cut was a click. Amplitude's tutorial narration crackled: 826 cuts in two and a half minutes, counted in a paced window with SDL's dummy audio driver.
Testing
Amplitude's tutorial, the window's own output recorded (SDL's dummy audio driver,
--wav): as many clicks as the game's own mix, 446 against 444 in the same 80 s. Those are the voice's and the music's own.This applies to every port with real-time sound. Only the drift case changes, and it now resamples instead of cutting.
🤖 Generated with Claude Code