Thank you so much! You were absolutely correct. r32 is an alias for float. runningSampleIndex is increasing indefinitely, and the larger the number, the more float loses precision.
The solution was to not grow runningSameIndex indefinitely, but reset it every period, so that it always stays in [0, framesPerPeriod] range.
Topic:
Media Technologies
SubTopic:
Audio
Tags: