oIn = mmioOpen(sSoundFile, mmioinf, MMIO_READ)
   If (m_hMMioIn = 0) Then
      pInternalErrorHandler 2
      Exit Function
   End If

   ' Check if this is a wave file
   mmckinfoParentIn.fccType = mmioStringToFOURCC("WAVE", 0)
   lR = mmioDescendParent(m_hMMioIn, mmckinfoParentIn, 0, MMIO_FINDRIFF)
   If Not (lR = MMSYSERR_NOERROR) Then
      CloseFile
      pInternalErrorHandler 3
      Exit Function
   End If

   ' Get format info
   mmckinfoSubchunkIn.ckid = mmioStringToFOURCC("fmt", 0)
   lR = mmioDes