wave(4)                                                                wave(4)


NAME
     wave, riff - Microsoft RIFF WAVE file format

SYNOPSIS
     #include <dmedia/audiofile.h>

DESCRIPTION
     The Audio File Library currently supports 13 of the commonly found audio
     file formats, i.e., is able to recognize, read, and write sample data and
     header information to and from files in these formats.  It is important
     not to confuse sample or audio data formats with file formats.  The
     former refers to the bit-wise organization of the sound samples in the
     file, i.e., whether the format is 8-bit integer or 16-bit unsigned, etc.
     Audio file format refers to the structure of the audio file header, the
     chunk of on-disk data which preceeds the samples and which provides
     information about the file to the audio program.  A single audio file
     format may support a large variety of sample formats.

     The Microsoft RIFF WAVE File Format (wave) was created by Microsoft,
     Inc., as an analog to the AIFF(4) file format.  It consists of a
     variable-length header followed by a contiguous block of binary data
     representing the sound samples.  Occasionally, additional chunks of non-
     audio information will be placed after the sound sample block.

DATA FORMAT SPECIFICATIONS
     Sample Formats:
          Two's complement integer for 9-bit and greater sample widths,
          unsigned for 8-bit and smaller sample widths.

     Sample Widths:
          From 1 to 32 bits, inclusive

     Byte Orders:
          Always littleendian (only applies to 9-bit and greater widths)

     Channel Counts:
          Any positive nonzero number, 1 and 2 most common

     Compression Formats:
          U-Law (AF_COMPRESSION_G711_ULAW)

          A-Law (AF_COMPRESSION_G711_ALAW)

          IMA ADPCM (AF_COMPRESSION_DVI_AUDIO)

     Note that WAVE ADPCM compression is not currently supported by the Audio
     File Library.

FILE FORMAT SPECIFICATIONS
     WAVE file headers can contain large amounts of additional information.


     Instrument Configurations:
          Maximum of 1 allowed.  Any number of loops per inst.  Inst is stored
          in a WAVE 'playlist' containing an arbitrary number of sound
          segments to be played and repeated.  As in an AIFF(4) file, each
          loop contains a reference to a marker (one in the case of WAVE
          rather than two as in AIFF).  Markers are known as 'cue's.  A loop
          is stored as a reference to a starting cue, a length in samples,
          plus a loop count (retrievable via afGetLoopCount(3dm)).  Instparams
          associated with this inst:


          AF_INST_MIDI_BASENOTE
          AF_INST_NUMCENTS_DETUNE
          AF_INST_MIDI_LONOTE
          AF_INST_MIDI_HINOTE
          AF_INST_MIDI_LOVELOCITY
          AF_INST_MIDI_HIVELOCITY
          AF_INST_NUMDBS_GAIN

     Markers:
          Any number of markers (known as 'cues' in WAVE file format) is
          allowed. There must be at least one marker if there are loops
          present in the file. There may be any number of "independent"
          markers (not associated with loops) plus those needed to define the
          starting positions of the loops present (see afSetLoopStart(3dm) and
          related pages for further information).

     In addition, it is possible to associate both a name string and a comment
     string with each marker.  The routines afInitMarkName(3dm) and
     afInitMarkComment(3dm) will do this.

     Miscellaneous Chunks:

               AF_MISC_COPY            copyright string

               AF_MISC_AUTH            author string

               AF_MISC_NAME            name string

               AF_MISC_COMMENT         text comment string

               AF_MISC_ICRD            creation date string

               AF_MISC_ISFT            software name string


SEE ALSO
     afInitFileFormat(3dm), afGetFileFormat(3dm), afIntro(3dm),
     afInitCompression(3dm), afGetCompression(3dm), afSetLoopStart(3dm),
     afSetLoopEnd(3dm)


                                                                        Page 2