added another safeguard for clipping the beginning/end of recorded audio data