fix the issue that an uncertain length of zero padding might suffix the
recorded wave file