libsndfile/libsamplerate

src_process returns less samples than requested if the rate recently changed

mbacarella opened this issue · 3 comments

I noticed audio that I was filtering through libsamplerate would stutter a bit right after a sample rate change. It was because src_process was producing slightly fewer samples than requested, so my audio playback buffer wasn't being completely filled.

I looked around at toy programs that use libsamplerate and saw that some of them add 64 to the input_frames after computing the ratio of input_frames.

When I add 64 to input_frames in my program it stops stuttering as well. What behavior is this relying on?

Well that indeed solves the mystery. I was not aware there was a FAQ. Thank you!

You're welcome.