Windows Sound(wav.rfh):
Class: Graphics and Sounds, Status: Almost Complete, Last change: 3/8/2008 6:06:32 PM

include win_cf.rfi

type
  DWORD ulong

  TWAVTag array[4] of Char

  TWaveFormatTag enum word (
    WAVE_FORMAT_UNKNOWN   = 0x0000, /*  Microsoft Corporation  */
    WAVE_FORMAT_PCM = 0x0001,
    WAVE_FORMAT_ADPCM     = 0x0002, /*  Microsoft Corporation  */
    WAVE_FORMAT_IBM_CVSD  = 0x0005, /*  IBM Corporation  */
    WAVE_FORMAT_ALAW      = 0x0006, /*  Microsoft Corporation  */
    WAVE_FORMAT_MULAW     = 0x0007, /*  Microsoft Corporation  */
    WAVE_FORMAT_OKI_ADPCM = 0x0010, /*  OKI  */
    WAVE_FORMAT_DVI_ADPCM = 0x0011, /*  Intel Corporation  */
//    WAVE_FORMAT_IMA_ADPCM  (WAVE_FORMAT_DVI_ADPCM) /*  Intel Corporation  */
    WAVE_FORMAT_MEDIASPACE_ADPCM  = 0x0012, /*  Videologic  */
    WAVE_FORMAT_SIERRA_ADPCM      = 0x0013, /*  Sierra Semiconductor Corp  */
    WAVE_FORMAT_G723_ADPCM = 0x0014, /*  Antex Electronics Corporation  */
    WAVE_FORMAT_DIGISTD = 0x0015, /*  DSP Solutions, Inc.  */
    WAVE_FORMAT_DIGIFIX = 0x0016, /*  DSP Solutions, Inc.  */
    WAVE_FORMAT_DIALOGIC_OKI_ADPCM = 0x0017, /*  Dialogic Corporation  */
    WAVE_FORMAT_YAMAHA_ADPCM = 0x0020, /*  Yamaha Corporation of America  */
    WAVE_FORMAT_SONARC = 0x0021, /*  Speech Compression  */
    WAVE_FORMAT_DSPGROUP_TRUESPEECH = 0x0022, /*  DSP Group, Inc  */
    WAVE_FORMAT_ECHOSC1 = 0x0023, /*  Echo Speech Corporation  */
    WAVE_FORMAT_AUDIOFILE_AF36 = 0x0024, /*    */
    WAVE_FORMAT_APTX = 0x0025, /*  Audio Processing Technology  */
    WAVE_FORMAT_AUDIOFILE_AF10    = 0x0026, /*    */
    WAVE_FORMAT_DOLBY_AC2 = 0x0030, /*  Dolby Laboratories  */
    WAVE_FORMAT_GSM610    = 0x0031, /*  Microsoft Corporation  */
    WAVE_FORMAT_ANTEX_ADPCME      = 0x0033, /*  Antex Electronics Corporation  */
    WAVE_FORMAT_CONTROL_RES_VQLPC = 0x0034, /*  Control Resources Limited  */
    WAVE_FORMAT_DIGIREAL  = 0x0035, /*  DSP Solutions, Inc.  */
    WAVE_FORMAT_DIGIADPCM = 0x0036, /*  DSP Solutions, Inc.  */
    WAVE_FORMAT_CONTROL_RES_CR10  = 0x0037, /*  Control Resources Limited  */
    WAVE_FORMAT_NMS_VBXADPCM      = 0x0038, /*  Natural MicroSystems  */
    WAVE_FORMAT_CS_IMAADPCM = 0x0039, /* Crystal Semiconductor IMA ADPCM */
    WAVE_FORMAT_G721_ADPCM = 0x0040, /*  Antex Electronics Corporation  */
    WAVE_FORMAT_MPEG      = 0x0050, /*  Microsoft Corporation  */
    WAVE_FORMAT_CREATIVE_ADPCM    = 0x0200, /*  Creative Labs, Inc  */
    WAVE_FORMAT_CREATIVE_FASTSPEECH8      = 0x0202, /*  Creative Labs, Inc  */
    WAVE_FORMAT_CREATIVE_FASTSPEECH10     = 0x0203, /*  Creative Labs, Inc  */
    WAVE_FORMAT_FM_TOWNS_SND      = 0x0300, /*  Fujitsu Corp.  */
    WAVE_FORMAT_OLIGSM    = 0x1000, /*  Ing C. Olivetti & C., S.p.A.  */
    WAVE_FORMAT_OLIADPCM  = 0x1001, /*  Ing C. Olivetti & C., S.p.A.  */
    WAVE_FORMAT_OLICELP   = 0x1002, /*  Ing C. Olivetti & C., S.p.A.  */
    WAVE_FORMAT_OLISBC    = 0x1003, /*  Ing C. Olivetti & C., S.p.A.  */
    WAVE_FORMAT_OLIOPR    = 0x1004, /*  Ing C. Olivetti & C., S.p.A.  */

    WAVE_FORMAT_DEVELOPMENT = 0xFFFF
  )

  TAdpcmCoef  struc
    int iCoef1
    int iCoef2
  ends

  TADPCMWAVEFORMAT struc
    WORD wSamplesPerBlock
    WORD wNumCoef
    array[@.wNumCoef]of TADPCMCOEF aCoeff
  ends

  TWavFormatData(Sz) struc
    TWaveFormatTag wFormatTag
    word wChannels
    long dwSamplesPerSec
    long dwAvgBytesPerSec
    word wBlockAlign
    word wBitsPerSample
    case @.wFormatTag of
      WAVE_FORMAT_PCM: void
    else struc
        word cbSize 
        case @@@.wFormatTag of
          WAVE_FORMAT_ADPCM: TADPCMWAVEFORMAT
        endc Dat
    	raw[] rest
      ends:[@:Size=@.cbSize+2]
    endc Extra
    raw[] rest
  ends:[@:Size=@:Sz]

  TCuePoint struc
    long    dwIdentifier
    long    dwPosition
    TWAVTag fccChunk
    long    dwChunkStart
    long    dwBlockStart
    long    dwSampleOffset
  ends

  TCueData struc
    long      dwCuePoints
    array[@.dwCuePoints] of TCuePoint points
  ends

  TPlayListSegment struc
    long    dwIdentifier //of Cue point
    long    dwLength
    long    dwRepeats
  ends

  TPlayListData struc
    long      dwSegments
    array[@.dwSegments] of TPlayListSegment Segments
  ends

  TSampleLoopType enum long (
    loopFwd=0, // Loop forward (normal)
    loopAlt=1, // Alternating loop (forward/backward)
    loopBk =2  // Loop backward
  )

  TSampleLoop struc
    long  dwIdentifier
    TSampleLoopType dwType
    ulong  dwStart
    ulong  dwEnd
    long  dwFraction
    long  dwPlayCount
  ends

  TSamplerData struc
    ulong           dwManufacturer
    ulong           dwProduct
    long           dwSamplePeriod
    long           dwMIDIUnityNote
    long           dwMIDIPitchFraction
    long           dwSMPTEFormat
    long           dwSMPTEOffset
    long           cSampleLoops
    long           cbSamplerData
    array[@.cSampleLoops] of TSampleLoop Loops
    raw[@.cbSamplerData] SamplerData
  ends

  TInstrumentData struc
    byte UnshiftedNote
    sint FineTune
    sint Gain
    byte LowNote
    byte HighNote
    byte LowVelocity
    byte HighVelocity
  ends

  TFactData struc
    ulong dwTotalSamples //Number of samples
    raw[] rest
  ends

  TWAVINFOSec struc
    TWAVTag Tag
    DWORD Sz
/*
    case @.Tag of
      'INAM','IART': array of Char
    else raw[]
    endc Dat
*/
    array[@.Sz] of Char Dat
    (align 2) Al
  ends //:[@.Dat:Size=@.Sz]

  TLblText struc
    long    dwIdentifier //of Cue point
    array of Char Txt
  ends

  TLabelTextData struc
    long    dwIdentifier //of Cue point
    long    dwSampleLength
    TWAVTag dwPurpose
    word   wCountry
    word   wLanguage
    word   wDialect
    word   wCodePage
    array of Char Txt
  ends

  TAssocDataSec struc
    TWAVTag Tag
    DWORD Sz
    case @.Tag of
      'labl','note': TLblText
      'ltxt': TLabelTextData
    else raw[]
    endc Dat
  ends:[@.Dat:Size=@.Sz]

  TWavDataSec raw[]

  TWAVListSec(Sz) struc
    TWAVTag Tag
    case @.Tag of
      'INFO': array of TWAVINFOSec
      'adtl': array of TAssocDataSec
//      'wavl': array of TWavListSec
    else raw[]
    endc Tbl
  ends:[@:Size=@:Sz]

  TDISPData(Sz) struc
    THClipboardFmt Kind
    raw[] rest
  ends:[@:Size=@:Sz]

  TWAVMainSec struc
    TWAVTag Tag
    DWORD Sz
    case @.Tag of
     'data': TWavDataSec
     'fmt ': TWavFormatData
     'cue ': TCueData
     'plst': TPlayListData
     'smpl': TSamplerData
     'inst': TInstrumentData
     'fact': TFactData
     'DISP': TDISPData(@@.Sz)
     'LIST': TWAVListSec(@@.Sz)
    else raw[]
    endc Dat
  ends:[@.Dat:Size=@.Sz]

  TWAVData(Sz) struc
    TWAVTag riffType
    case @.riffType of
      'WAVE': array of TWAVMainSec
    else
      raw[]
    endc Tbl
  ends:[@:Size=@:Sz]

  TWAVHdr struc
    TWAVTag Tag
    case @.Tag of
     'RIFF': struc
       DWORD Sz
       TWAVData(@.Sz) Wav
     ends
    endc Dat
  ends

data
0 TWAVHdr Hdr


Other specifications.


FlexT home page, Author`s home page.