code: def read_data(self, block_samples=1024):
          
          old_width = self._file.getsampwidth()
  
          while True:
              data = self._file.readframes(block_samples)
              if not data:
                  break
  
              # Make sure we have the desired bitdepth and endianness.
              data = audioop.lin2lin(data, old_width, TARGET_WIDTH)
              if self._needs_byteswap and self._file.getcomptype() != 'sowt':
                  # Big-endian data. Swap endianness.
                  data = byteswap(data)
              yield data
docs: Generates blocks of PCM data found in the file.