sbooth / SFBAudioEngine

A powerhouse of audio functionality for macOS, iOS, and tvOS
https://sbooth.github.io/SFBAudioEngine/
MIT License
569 stars 86 forks source link

Reset the ring buffer immediately on seek #121

Closed sbooth closed 4 years ago

sbooth commented 4 years ago

This PR prevents waiting on the check framesAvailableToWrite >= kRingBufferChunkSize to pass before requesting a ring buffer reset.

Waiting for the check to pass requires the ring buffer to render at least kRingBufferChunkSize audio frames before the seek is processed, which results in an audible artifact.