code: def align_buf(buf, sample_width):
      
      remainder = len(buf) % sample_width
      if remainder != 0:
          buf += b'\0' * (sample_width - remainder)
      return buf
docs: In case of buffer size not aligned to sample_width pad it with 0s