Fix audio glitches when merging resampled audio (#2373).