That was a great stream about audio syncing.
With the very last modification done, the ExpectedFrameBoundaryByte wasn't updated to the better value.
The very last line in this code block:
| DWORD ExpectedSoundBytesPerFrame = (SoundOutput.SamplesPerSecond*SoundOutput.BytesPerSample) / GameUpdateHz;
real32 SecondsLeftUntilFlip = (TargetSecondsPerFrame - FromBeginToAudioSeconds);
DWORD ExpectedBytesUntilFlip = (DWORD)((SecondsLeftUntilFlip/TargetSecondsPerFrame)*(real32)ExpectedSoundBytesPerFrame);
DWORD ExpectedFrameBoundaryByte = PlayCursor + ExpectedSoundBytesPerFrame;
|
What it probably should be:
| DWORD ExpectedFrameBoundaryByte = PlayCursor + ExpectedBytesUntilFlip;
|