  $ FileName "t.exe"

  $ FileName "t.exe"
  'uses rtl32


  'http://www.tactilemedia.com/info/MCI_Control_Info.html


  type WaveFormat 
    word  wFormatTag; 
    word  nChannels; 
    dword nSamplesPerSec; 
    dword nAvgBytesPerSec; 
    word  nBlockAlign; 
    word  wBitsPerSample; 
  end type

'16 bytes



  type WaveFileHeader
    dword   RiffLabel
    dword   FileSize
    dword   WaveLabel
    dword   fmtLabel
    dword   WaveFormatSize
    WaveFormat
    dword   DataLabel
    dword   DataSize
  end type '44 bytes

'44 bytes



  '#recordof WaveFileHeader

  
  WaveFileHeader *wfh  
  string fi,wav
  fi="beep.wav"
  getfile fi,wav
  '
  if len(wav)=0
  '
  print "File problem " fi
  '
  else

  @wfh=*wav
  string cr=chr(13)+chr(10)
  string pr
  pr="Wave Data:" cr+
  mid (wav,1,4) cr+     'RIFF'
  wfh.filesize cr+
  mid (wav,9,4) cr+     'WAVE'
  mid (wav,13,4) cr+    'fmt '
  wfh.datasize cr+
  wfh.wFormatTag cr+
  wfh.nChannels cr+
  wfh.nSamplesPerSec cr+ 
  wfh.nAvgBytesPerSec cr+
  wfh.nBlockAlign cr+
  wfh.wBitsPerSample cr+
  mid (wav,37,4) cr+    'data'
  wfh.DataSize cr+
  cr
   
  print pr

  endif
  


