Audio Code

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:

1
2
3
4
5
6
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:
1
DWORD ExpectedFrameBoundaryByte = PlayCursor + ExpectedBytesUntilFlip;
Thanks for the catch!!! I hope that improves our problem... unfortunately I have to wait until Monday to find out :(

- Casey