docs: def _wavGetInfo(f:Union[IO, str]) -> Tuple[SndInfo, Dict[str, Any]]:
      """
      Read the info of a wav file. taken mostly from scipy.io.wavfile
  
      if extended: returns also fsize and bigendian
      """
      if isinstance(f, (str, bytes)):
          f = open(f, 'rb')
          needsclosing = True
      else:
          needsclosing = False
      fsize, bigendian = _wavReadRiff(f)
      fmt = ">i" if bigendian else "<i"
      while (f.tell() < fsize):
          chunk_id = f.read(4)
          if chunk_id == b'fmt ':
              chunksize, sampfmt, chans, sr, byterate, align, bits = _wavReadFmt(f, bigendian)
          elif chunk_id == b'data':
              datasize = _struct.unpack(fmt, f.read(4))[0]
              nframes = int(datasize / (chans * (bits / 8)))
              break
          else:
              _warnings.warn("chunk not understood: %s" % chunk_id)
              data = f.read(4)
              size = _struct.unpack(fmt, data)[0]
              f.seek(size, 1)
      encoding = _encoding(sampfmt, bits)
      if needsclosing:
          f.close()
      info = SndInfo(sr, nframes, chans, encoding, "wav")
      return info, {'fsize': fsize, 'bigendian': bigendian, 'datasize': datasize}