Skip to content

Fix stuttering audio in in-game recordings - #51

Merged
MisterGatto merged 1 commit into
skyprotocol:osp-masterfrom
HugeFrog24:fix/recording-audio
Oct 17, 2026
Merged

MisterGatto merged 1 commit into
skyprotocol:osp-masterfrom
HugeFrog24:fix/recording-audio

Conversation

@HugeFrog24

Copy link
Copy Markdown
Contributor

The game copies one FMOD block of 16-bit stereo samples into the audio direct buffer per write and never checks its capacity, and the encoder queues the whole buffer. Vanilla sizes that buffer from the 10th StartRecording argument (1024 bytes when set, 2048 otherwise); Canvas dropped the argument and always used 2048, so each 1024-byte block was queued with 1024 stale bytes. Forward the argument to createAudioCodec as vanilla 0.34.5 to 0.35.1 does.

Known issue, not addressed here: video frames also stutter. I haven't found the cause yet and will look into it separately. This PR doesn't touch the video path, so there's no regression either way. The audio fix stands on its own.

The game copies one FMOD block of 16-bit stereo samples into the audio direct buffer per write and never checks its capacity, and the encoder queues the whole buffer. Vanilla sizes that buffer from the 10th StartRecording argument (1024 bytes when set, 2048 otherwise); Canvas dropped the argument and always used 2048, so each 1024-byte block was queued with 1024 stale bytes. Forward the argument to createAudioCodec as vanilla 0.34.5 to 0.35.1 does.
@MisterGatto
MisterGatto merged commit a824aec into skyprotocol:osp-master Oct 17, 2026
1 check failed
@HugeFrog24
HugeFrog24 deleted the fix/recording-audio branch October 17, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants