if file buffer is considerably bigger than max_samples than keeping track of samples read instead of samples returned might result in a significantly shorter play