home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / FAQSYS18.ZIP / FAQS.DAT / RIFF.TXT < prev    next >
Text File  |  1996-01-04  |  32KB  |  836 lines

  1. RIFF WAVE (.WAV) file format
  2. ----------------------------
  3.  
  4. The following is taken from RIFFMCI.RTF, "Multimedia Programming Interface
  5. and Data Specification v1.0", a Windows RTF (Rich Text Format) file contained
  6. in the .zip file, RMRTF.ZRT.  The original document is quite long and this
  7. constitutes pages 83-95 of the text format version (starting on roughly
  8. page 58 of the RTF version). 
  9.  
  10.  
  11. About the RIFF Tagged File Format
  12.  
  13.      
  14.      RIFF (Resource Interchange File Format) is the tagged file structure
  15.      developed for multimedia resource files.  The structure of a RIFF file
  16.      is similar to the structure of an Electronic Arts IFF file. RIFF is
  17.      not actually a file format itself (since it does not represent a
  18.      specific kind of information), but its name contains the words
  19.      ``interchange file format'' in recognition of its roots in IFF. Refer
  20.      to the EA IFF definition document, EA IFF 85 Standard for Interchange
  21.      Format Files, for a list of reasons to use a tagged file format.
  22.      
  23.      RIFF has a counterpart, RIFX, that is used to define RIFF file formats
  24.      that use the Motorola integer byte- ordering format rather than the
  25.      Intel format. A RIFX file is the same as a RIFF file, except that the
  26.      first four bytes are `RIFX' instead of `RIFF', and integer byte
  27.      ordering is represented in Motorola format.
  28.  
  29. Notation Conventions
  30.  
  31.      
  32.      The following table lists some of the notation conventions used in
  33.      this document. Further conventions and the notation for documenting
  34.      RIFF forms are presented later in the document in the section
  35.      ``Notation for Representing Sample RIFF Files.''
  36.      
  37.                         
  38.      Notation               Description                            
  39.      <element label>        RIFF file element with the label       
  40.                             ``element label''                      
  41.      <element label: TYPE>  RIFF file element with data type                   
  42.                 ``TYPE''                               
  43.      [<element label>]         Optional RIFF file element             
  44.  
  45.      <element label>...     One or more copies of the              
  46.                  specified element                      
  47.  
  48.      [<element label>]...   Zero or more copies of the             
  49.                  specified element                            
  50.                         
  51.  
  52. Chunks
  53.  
  54.      
  55.      The basic building block of a RIFF file is called a
  56.      chunk. Using C syntax, a chunk can be defined as
  57.      follows:
  58.       
  59.       typedef unsigned long DWORD;
  60.       typedef unsigned char BYTE;
  61.       
  62.       typedef DWORD FOURCC;        // Four-character code
  63.       
  64.       typedef FOURCC CKID;         // Four-character-code chunk identifier
  65.       typedef DWORD CKSIZE;        // 32-bit unsigned size
  66.       value
  67.       
  68.       typedef struct {             // Chunk structure
  69.           CKID     ckID;           // Chunk type identifier
  70.           CKSIZE   ckSize;         // Chunk size field (size of ckData)
  71.           BYTE     ckData[ckSize]; // Chunk data
  72.       } CK;
  73.      
  74.      A FOURCC is represented as a sequence of one to four ASCII
  75.      alphanumeric characters, padded on the right with blank characters
  76.      (ASCII character value 32) as required, with no embedded blanks.
  77.      
  78.      For example, the four-character code `FOO' is stored as
  79.      a sequence of four bytes: 'F', 'O', 'O', ' ' in
  80.      ascending addresses. For quick comparisons, a four-
  81.      character code may also be treated as a 32-bit number.
  82.      
  83.      The three parts of the chunk are described in the
  84.      following table:
  85.      
  86.                
  87.      Part      Description
  88.      ckID      A four-character code that identifies the
  89.                representation of the chunk data data. A
  90.                program reading a RIFF file can skip over
  91.                any chunk whose chunk ID it doesn't
  92.                recognize; it simply skips the number of
  93.                bytes specified by ckSize plus the pad
  94.                byte, if present.
  95.      ckSize    A 32-bit unsigned value identifying the
  96.                size of ckData. This size value does not
  97.                include the size of the ckID or ckSize
  98.                fields or the pad byte at the end of
  99.                ckData.
  100.      ckData    Binary data of fixed or variable size. The
  101.                start of ckData is word-aligned with
  102.                respect to the start of the RIFF file. If
  103.                the chunk size is an odd number of bytes, a
  104.                pad byte with value zero is written after
  105.                ckData. Word aligning improves access speed
  106.                (for chunks resident in memory) and
  107.                maintains compatibility with EA IFF. The
  108.                ckSize value does not include the pad byte.
  109.                
  110.      
  111.      We can represent a chunk with the following notation
  112.      (in this example, the ckSize and pad byte are
  113.      implicit):
  114.       
  115.       <ckID> ( <ckData> )
  116.      
  117.      Two types of chunks, the `LIST' and `RIFF' chunks, may
  118.      contain nested chunks, or subchunks. These special
  119.      chunk types are discussed later in this document. All
  120.      other chunk types store a single element of binary data
  121.      in <ckData>.
  122.  
  123.  
  124.      Using the notation for representing a chunk, a RIFF form looks like
  125.      the following:
  126.       
  127.       RIFF ( <formType> <ck>... )
  128.      
  129.      The first four bytes of a RIFF form make up a chunk ID with values
  130.      `R', `I', `F', `F'. The ckSize field is required, but for simplicity
  131.      it is omitted from the notation.
  132.      
  133.      The first DWORD of chunk data in the `RIFF' chunk (shown above as
  134.      <formType>) is a four-character code value identifying the data
  135.      representation, or form type, of the file. Following the form-type
  136.      code is a series of subchunks. Which subchunks are present depends on
  137.      the form type.
  138.  
  139.  
  140.  
  141.           Waveform Audio File Format (WAVE)
  142.  
  143.  
  144.                This section describes the Waveform format, which is used to
  145.                represent digitized sound.
  146.  
  147.                The WAVE form is defined as follows. Programs must expect
  148.                (and ignore) any unknown chunks encountered, as with all
  149.                RIFF forms. However, <fmt-ck> must always occur before
  150.                <wave-data>, and both of these chunks are mandatory in a
  151.                WAVE file.
  152.  
  153.                 <WAVE-form> ->
  154.                       RIFF( 'WAVE'
  155.                            <fmt-ck>               // Format
  156.                            [<fact-ck>]            // Fact chunk
  157.                            [<cue-ck>]             // Cue points
  158.                            [<playlist-ck>]        // Playlist
  159.                            [<assoc-data-list>]    // Associated data list
  160.                            <wave-data>   )        // Wave data
  161.  
  162.                The WAVE chunks are described in the following sections.
  163.  
  164.  
  165.           WAVE Format Chunk
  166.  
  167.  
  168.                The WAVE format chunk <fmt-ck> specifies the format of the
  169.                <wave-data>. The <fmt-ck> is defined as follows:
  170.  
  171.                 <fmt-ck> ->   fmt( <common-fields>
  172.                                  <format-specific-fields> )
  173.  
  174.                 <common-fields> ->
  175.                       struct
  176.                       {
  177.                          WORD wFormatTag;         // Format category
  178.                          WORD wChannels;          // Number of channels
  179.                          DWORDdwSamplesPerSec;    // Sampling rate
  180.                          DWORDdwAvgBytesPerSec;   // For buffer estimation
  181.                          WORD wBlockAlign;        // Data block size
  182.                       }
  183.  
  184.                The fields in the <common-fields> chunk are as follows:
  185.  
  186.  
  187.  
  188.                Field             Description
  189.                 
  190.                wFormatTag          A number indicating the WAVE format
  191.                                    category of the file. The content of
  192.                                    the <format-specific-fields> portion
  193.                                    of the `fmt' chunk, and the
  194.                                    interpretation of the waveform data,
  195.                                    depend on this value.
  196.                 
  197.                                    You must register any new WAVE format
  198.                                    categories. See ``Registering
  199.                                    Multimedia Formats'' in Chapter 1,
  200.                                    ``Overview of Multimedia
  201.                                    Specifications,'' for information on
  202.                                    registering WAVE format categories.
  203.                 
  204.                                    ``Wave Format Categories,'' following
  205.                                    this section, lists the currently
  206.                                    defined WAVE format categories.
  207.                 
  208.                wChannels           The number of channels represented in
  209.                                    the waveform data, such as 1 for mono
  210.                                    or 2 for stereo.
  211.                 
  212.                dwSamplesPerSec   The sampling rate (in samples per
  213.                                    second) at which each channel should
  214.                  be played.
  215.  
  216.                dwAvgBytesPerSec  The average number of bytes per second
  217.                                    at which the waveform data should be
  218.                                    transferred. Playback software can
  219.                  estimate the buffer size using this value.
  220.                                   
  221.                wBlockAlign      The block alignment (in bytes) of the
  222.                                    waveform data. Playback software needs
  223.                                    to process a multiple of wBlockAlign
  224.                                    bytes of data at a time, so the value
  225.                  of wBlockAlign can be used for buffer
  226.                  alignment.
  227.  
  228.                The <format-specific-fields> consists of zero or more bytes
  229.                of parameters. Which parameters occur depends on the WAVE
  230.                format category-see the following section for details.
  231.                Playback software should be written to allow for (and
  232.                ignore) any unknown <format-specific-fields> parameters that
  233.                occur at the end of this field.
  234.  
  235.  
  236.  
  237.           WAVE Format Categories
  238.  
  239.  
  240.                The format category of a WAVE file is specified by the value
  241.                of the wFormatTag field of the `fmt' chunk. The
  242.                representation of data in <wave-data>, and the content of
  243.                the <format-specific-fields> of the `fmt' chunk, depend on
  244.                the format category.
  245.  
  246.                The currently defined open non-proprietary WAVE format
  247.                categories are as follows:
  248.  
  249.  
  250.  
  251.                wFormatTag Value         Format Category
  252.  
  253.  
  254.                WAVE_FORMAT_PCM (0x0001) Microsoft Pulse Code
  255.                                         Modulation (PCM) format
  256.  
  257.  
  258.  
  259.                The following are the registered proprietary WAVE format
  260.                categories:
  261.  
  262.  
  263.  
  264.                wFormatTag Value         Format Category
  265.  
  266.  
  267.                IBM_FORMAT_MULAW         IBM mu-law format
  268.                (0x0101)
  269.  
  270.                IBM_FORMAT_ALAW (0x0102) IBM a-law format
  271.  
  272.                IBM_FORMAT_ADPCM         IBM AVC Adaptive
  273.                (0x0103)                 Differential Pulse Code
  274.                                         Modulation format
  275.  
  276.  
  277.  
  278.                The following sections describe the Microsoft
  279.                WAVE_FORMAT_PCM format.
  280.  
  281.  
  282.                Pulse Code Modulation (PCM) Format
  283.  
  284.  
  285.                If the wFormatTag field of the <fmt-ck> is set to
  286.                WAVE_FORMAT_PCM, then the waveform data consists of samples
  287.                represented in pulse code modulation (PCM) format. For PCM
  288.                waveform data, the <format-specific-fields> is defined as
  289.                follows:
  290.  
  291.                 <PCM-format-specific> ->
  292.                       struct
  293.                       {
  294.                          WORD wBitsPerSample;      // Sample size
  295.                       }
  296.  
  297.                The wBitsPerSample field specifies the number of bits of
  298.                data used to represent each sample of each channel. If there
  299.                are multiple channels, the sample size is the same for each
  300.                channel.
  301.  
  302.                For PCM data, the wAvgBytesPerSec field of the `fmt' chunk
  303.                should be equal to the following formula rounded up to the
  304.                next whole number:
  305.  
  306.                                               wBitsPerSample
  307.                  wChannels x wBitsPerSecond x --------------
  308.                                                      8
  309.  
  310.                The wBlockAlign field should be equal to the following
  311.                formula, rounded to the next whole number:
  312.  
  313.                              wBitsPerSample
  314.                  wChannels x --------------
  315.                                     8
  316.  
  317.                Data Packing for PCM WAVE Files
  318.  
  319.                In a single-channel WAVE file, samples are stored
  320.                consecutively. For stereo WAVE files, channel 0 represents
  321.                the left channel, and channel 1 represents the right
  322.                channel. The speaker position mapping for more than two
  323.                channels is currently undefined. In multiple-channel WAVE
  324.                files, samples are interleaved.
  325.  
  326.                The following diagrams show the data packing for a 8-bit
  327.                mono and stereo WAVE files:
  328.  
  329.  
  330.                      Sample 1     Sample 2     Sample 3    Sample 4
  331.  
  332.  
  333.                      Channel 0    Channel 0   Channel 0    Channel 0
  334.  
  335.  
  336.  
  337.                              Data Packing for 8-Bit Mono PCM
  338.  
  339.  
  340.  
  341.                             Sample 1                 Sample 2
  342.  
  343.                      Channel 0    Channel 1   Channel 0    Channel 0
  344.                       (left)       (right)      (left)      (right)
  345.  
  346.  
  347.  
  348.                             Data Packing for 8-Bit Stereo PCM
  349.  
  350.  
  351.  
  352.                The following diagrams show the data packing for 16-bit mono
  353.                and stereo WAVE files:
  354.  
  355.  
  356.                             Sample 1                 Sample 2
  357.  
  358.                      Channel 0    Channel 0   Channel 0    Channel 0
  359.  
  360.                      low-order   high-order   low-order   high-order
  361.                        byte         byte         byte        byte
  362.  
  363.  
  364.                              Data Packing for 16-Bit Mono PCM
  365.  
  366.  
  367.  
  368.                                         Sample 1
  369.  
  370.                      Channel 0    Channel 0   Channel 1    Channel 1
  371.                       (left)       (left)      (right)      (right)
  372.                      low-order   high-order   low-order   high-order
  373.                        byte         byte         byte        byte
  374.  
  375.  
  376.                             Data Packing for 16-Bit Stereo PCM
  377.  
  378.  
  379.  
  380.                Data Format of the Samples
  381.  
  382.                Each sample is contained in an integer i. The size of i is
  383.                the smallest number of bytes required to contain the
  384.                specified sample size. The least significant byte is stored
  385.                first. The bits that represent the sample amplitude are
  386.                stored in the most significant bits of i, and the remaining
  387.                bits are set to zero.
  388.  
  389.                For example, if the sample size (recorded in nBitsPerSample)
  390.                is 12 bits, then each sample is stored in a two-byte
  391.                integer. The least significant four bits of the first (least
  392.                significant) byte is set to zero.
  393.  
  394.                The data format and maximum and minimums values for PCM
  395.                waveform samples of various sizes are as follows:
  396.  
  397.  
  398.  
  399.                Sample Size  Data Format Maximum Value  Minimum Value
  400.  
  401.  
  402.                One to       Unsigned    255 (0xFF)     0
  403.                eight bits   integer
  404.  
  405.                Nine or      Signed      Largest        Most negative
  406.                more bits    integer i   positive       value of i
  407.                                         value of i
  408.  
  409.  
  410.                For example, the maximum, minimum, and midpoint values for
  411.                8-bit and 16-bit PCM waveform data are as follows:
  412.  
  413.                Format       Maximum     Minimum Value  Midpoint
  414.                             Value                      Value
  415.  
  416.  
  417.                8-bit PCM    255 (0xFF)  0              128 (0x80)
  418.  
  419.                16-bit PCM   32767       -32768         0
  420.                             (0x7FFF)    (-0x8000)
  421.  
  422.  
  423.                Examples of PCM WAVE Files
  424.  
  425.                Example of a PCM WAVE file with 11.025 kHz sampling rate,
  426.                mono, 8 bits per sample:
  427.  
  428.                 RIFF( 'WAVE'     fmt(1, 1, 11025, 11025, 1, 8)
  429.                               data( <wave-data> ) )
  430.  
  431.                Example of a PCM WAVE file with 22.05 kHz sampling rate,
  432.                stereo, 8 bits per sample:
  433.  
  434.                 RIFF( 'WAVE'     fmt(1, 2, 22050, 44100, 2, 8)
  435.                               data( <wave-data> ) )
  436.  
  437.                Example of a PCM WAVE file with 44.1 kHz sampling rate,
  438.                mono, 20 bits per sample:
  439.  
  440.                 RIFF( 'WAVE'     INFO(INAM("O Canada"Z))
  441.                               fmt(1, 1, 44100, 132300, 3, 20)
  442.                               data( <wave-data> ) )
  443.  
  444.  
  445.           Storage of WAVE Data
  446.  
  447.  
  448.                The <wave-data> contains the waveform data. It is defined as
  449.                follows:
  450.  
  451.                 <wave-data>  ->  { <data-ck> : <data-list> }
  452.  
  453.                 <data-ck>    ->  data( <wave-data> )
  454.  
  455.                 <wave-list>  ->  LIST( 'wavl' { <data-ck> :  // Wave samples
  456.                                            <silence-ck> }... )   // Silence
  457.  
  458.                 <silence-ck> ->  slnt( <dwSamples:DWORD> )   // Count of
  459.                                                              // silent samples
  460.  
  461.                Note:  The `slnt' chunk represents silence, not necessarily
  462.                a repeated zero volume or baseline sample. In 16-bit PCM
  463.                data, if the last sample value played before the silence
  464.                section is a 10000, then if data is still output to the D to
  465.                A converter, it must maintain the 10000 value. If a zero
  466.                value is used, a click may be heard at the start and end of
  467.                the silence section. If play begins at a silence section,
  468.                then a zero value might be used since no other information
  469.                is available. A click might be created if the data following
  470.                the silent section starts with a nonzero value.
  471.  
  472.  
  473.           FACT Chunk
  474.  
  475.  
  476.                The <fact-ck> fact chunk stores important information about
  477.                the contents of the WAVE file. This chunk is defined as
  478.                follows:
  479.  
  480.                 <fact-ck> -> fact( <dwFileSize:DWORD> )     // Number
  481.                                                             // of samples
  482.  
  483.                The `fact'' chunk is required if the waveform data is
  484.                contained in a `wavl'' LIST chunk and for all compressed
  485.                audio formats. The chunk is not required for PCM files using
  486.                the `data'' chunk format.
  487.  
  488.                The "fact" chunk will be expanded to include any other
  489.                information required by future WAVE formats. Added fields
  490.                will appear following the <dwFileSize> field. Applications
  491.                can use the chunk size field to determine which fields are
  492.                present.
  493.  
  494.  
  495.           Cue-Points Chunk
  496.  
  497.  
  498.                The <cue-ck> cue-points chunk identifies a series of
  499.                positions in the waveform data stream. The <cue-ck> is
  500.                defined as follows:
  501.  
  502.                 <cue-ck> ->   cue( <dwCuePoints:DWORD>    // Count of cue points
  503.                                    <cue-point>... )       // Cue-point
  504.                 table
  505.  
  506.                 <cue-point> ->   struct {
  507.                                  DWORD  dwName;
  508.                                  DWORD  dwPosition;
  509.                                  FOURCC fccChunk;
  510.                                  DWORD  dwChunkStart;
  511.                                  DWORD  dwBlockStart;
  512.                                  DWORD  dwSampleOffset;
  513.                               }
  514.  
  515.                The <cue-point> fields are as follows:
  516.  
  517.  
  518.  
  519.                Field          Description
  520.  
  521.                dwName         Specifies the cue point name. Each
  522.                               <cue-point> record must have a unique
  523.                               dwName field.
  524.  
  525.                dwPosition     Specifies the sample position of the
  526.                               cue point. This is the sequential
  527.                               sample number within the play order.
  528.                               See ``Playlist Chunk,'' later in this
  529.                               document, for a discussion of the play
  530.                               order.
  531.  
  532.                fccChunk       Specifies the name or chunk ID of the
  533.                               chunk containing the cue point.
  534.  
  535.                dwChunkStart   Specifies the file position of the
  536.                               start of the chunk containing the cue
  537.                               point. This is a byte offset relative
  538.                               to the start of the data section of
  539.                               the `wavl' LIST chunk.
  540.  
  541.                dwBlockStart   Specifies the file position of the
  542.                               start of the block containing the
  543.                               position. This is a byte offset
  544.                               relative to the start of the data
  545.                               section of the `wavl' LIST chunk.
  546.  
  547.                dwSampleOffset Specifies the sample offset of the cue
  548.                               point relative to the start of the
  549.                               block.
  550.  
  551.  
  552.  
  553.  
  554.                Examples of File Position Values
  555.  
  556.  
  557.                The following table describes the <cue-point> field values
  558.                for a WAVE file containing multiple `data' and `slnt' chunks
  559.                enclosed in a `wavl' LIST chunk:
  560.  
  561.  
  562.  
  563.                Cue Point     Field         Value
  564.                Location
  565.  
  566.  
  567.                In a `slnt'   fccChunk      FOURCC value `slnt'.
  568.                chunk
  569.  
  570.                              dwChunkStart  File position of the
  571.                                            `slnt' chunk relative to
  572.                                            the start of the data
  573.                                            section in the `wavl' LIST
  574.                                            chunk.
  575.  
  576.                              dwBlockStart  File position of the data
  577.                                            section of the `slnt'
  578.                                            chunk relative to the
  579.                                            start of the data section
  580.                                            of the `wavl' LIST chunk.
  581.  
  582.                              dwSampleOffs  Sample position of the cue
  583.                              et            point relative to the
  584.                                            start of the `slnt' chunk.
  585.  
  586.                In a PCM      fccChunk      FOURCC value `data'.
  587.                `data' chunk
  588.  
  589.                              dwChunkStart  File position of the
  590.                                            `data' chunk relative to
  591.                                            the start of the data
  592.                                            section in the `wavl' LIST
  593.                                            chunk.
  594.  
  595.                              dwBlockStart  File position of the cue
  596.                                            point relative to the
  597.                                            start of the data section
  598.                                            of the `wavl' LIST chunk.
  599.  
  600.                              dwSampleOffs  Zero value.
  601.                              et
  602.  
  603.                In a          fccChunk      FOURCC value `data'.
  604.                compressed
  605.                `data' chunk
  606.  
  607.                              dwChunkStart  File position of the start
  608.                                            of the `data' chunk
  609.                                            relative to the start of
  610.                                            the data section of the
  611.                                            `wavl' LIST chunk.
  612.  
  613.                              dwBlockStart  File position of the
  614.                                            enclosing block relative
  615.                                            to the start of the data
  616.                                            section of the `wavl' LIST
  617.                                            chunk. The software can
  618.                                            begin the decompression at
  619.                                            this point.
  620.  
  621.                              dwSampleOffs  Sample position of the cue
  622.                              et            point relative to the
  623.                                            start of the block.
  624.  
  625.  
  626.  
  627.                The following table describes the <cue-point> field values
  628.                for a WAVE file containing a single `data' chunk:
  629.  
  630.                Cue Point     Field         Value
  631.                Location
  632.  
  633.  
  634.                Within PCM    fccChunk      FOURCC value `data'.
  635.                data
  636.  
  637.                              dwChunkStart  Zero value.
  638.  
  639.                              dwBlockStart  Zero value.
  640.  
  641.                              dwSampleOffs  Sample position of the cue
  642.                              et            point relative to the
  643.                                            start of the `data' chunk.
  644.  
  645.                In a          fccChunk      FOURCC value `data'.
  646.                compressed
  647.                `data' chunk
  648.  
  649.                              dwChunkStart  Zero value.
  650.  
  651.                              dwBlockStart  File position of the
  652.                                            enclosing block relative
  653.                                            to the start of the `data'
  654.                                            chunk. The software can
  655.                                            begin the decompression at
  656.                                            this point.
  657.  
  658.                              dwSampleOffs  Sample position of the cue
  659.                              et            point relative to the
  660.                                            start of the block.
  661.  
  662.  
  663.  
  664.           Playlist Chunk
  665.  
  666.  
  667.                The <playlist-ck> playlist chunk specifies a play order for
  668.                a series of cue points. The <playlist-ck> is defined as
  669.                follows:
  670.  
  671.                 <playlist-ck> ->   plst(
  672.                                  <dwSegments:DWORD>    // Count of play
  673.                 segments
  674.                                  <play-segment>... )   // Play-segment
  675.                 table
  676.  
  677.                 <play-segment> ->  struct {
  678.                                    DWORD dwName;
  679.                                    DWORD dwLength;
  680.                                    DWORD dwLoops;
  681.                                  }
  682.  
  683.                The <play-segment> fields are as follows:
  684.  
  685.                Field          Description
  686.  
  687.  
  688.                dwName         Specifies the cue point name. This
  689.                               value must match one of the names
  690.                               listed in the <cue-ck> cue-point
  691.                               table.
  692.  
  693.                dwLength       Specifies the length of the section in
  694.                               samples.
  695.  
  696.                dwLoops        Specifies the number of times to play
  697.                               the section.
  698.  
  699.  
  700.  
  701.  
  702.           Associated Data Chunk
  703.  
  704.  
  705.                The <assoc-data-list> associated data list provides the
  706.                ability to attach information like labels to sections of the
  707.                waveform data stream. The <assoc-data-list> is defined as
  708.                follows:
  709.  
  710.                 <assoc-data-list> ->  LIST('adtl'
  711.                                         <labl-ck>                // Label
  712.                                         <note-ck>                // Note
  713.                                         <ltxt-ck>                // Text
  714.                 with data length
  715.                                         <file-ck> )              // Media
  716.                 file
  717.  
  718.                 <labl-ck> ->       labl(<dwName:DWORD>
  719.                                         <data:ZSTR> )
  720.  
  721.                 <note-ck> ->       note(<dwName:DWORD>
  722.                                         <data:ZSTR> )
  723.  
  724.                 <ltxt-ck> ->       ltxt(<dwName:DWORD>
  725.                                         <dwSampleLength:DWORD>
  726.                                         <dwPurpose:DWORD>
  727.                                         <wCountry:WORD>
  728.                                         <wLanguage:WORD>
  729.                                         <wDialect:WORD>
  730.                                         <wCodePage:WORD>
  731.                                         <data:BYTE>... )
  732.  
  733.                 <file-ck> ->       file(<dwName:DWORD>
  734.                                         <dwMedType:DWORD>
  735.                                         <fileData:BYTE>...)
  736.  
  737.  
  738.  
  739.  
  740.                Label and Note Information
  741.  
  742.  
  743.                The `labl' and `note' chunks have similar fields. The `labl'
  744.                chunk contains a label, or title, to associate with a cue
  745.                point. The `note' chunk contains comment text for a cue
  746.                point. The fields are as follows:
  747.  
  748.  
  749.  
  750.                Field          Description
  751.  
  752.  
  753.                dwName         Specifies the cue point name.  This
  754.                               value must match one of the names
  755.                               listed in the <cue-ck> cue-point
  756.                               table.
  757.  
  758.                data           Specifies a NULL-terminated string
  759.                               containing a text label (for the
  760.                               `labl' chunk) or comment text (for the
  761.                               `note' chunk).
  762.  
  763.  
  764.  
  765.  
  766.                Text with Data Length Information
  767.  
  768.  
  769.                The ``ltxt'' chunk contains text that is associated with a
  770.                data segment of specific length. The chunk fields are as
  771.                follows:
  772.  
  773.  
  774.  
  775.                Field          Description
  776.  
  777.  
  778.                dwName         Specifies the cue point name.  This
  779.                               value must match one of the names
  780.                               listed in the <cue-ck> cue-point
  781.                               table.
  782.  
  783.                dwSampleLength Specifies the number of samples in the
  784.                               segment of waveform data.
  785.  
  786.                dwPurpose      Specifies the type or purpose of the
  787.                               text. For example, dwPurpose can
  788.                               specify a FOURCC code like `scrp' for
  789.                               script text or `capt' for close-
  790.                               caption text.
  791.  
  792.                wCountry       Specifies the country code for the
  793.                               text. See ``Country Codes'' in Chapter
  794.                               2, ``Resource Interchange File
  795.                               Format,'' for a current list of
  796.                               country codes.
  797.  
  798.                wLanguage,     Specify the language and dialect codes
  799.                wDialect       for the text. See ``Language and
  800.                               Dialect Codes'' in Chapter 2,
  801.                               ``Resource Interchange File Format,''
  802.                               for a current list of language and
  803.                               dialect codes.
  804.  
  805.                wCodePage      Specifies the code page for the text.
  806.  
  807.  
  808.  
  809.  
  810.                Embedded File Information
  811.  
  812.  
  813.                The `file' chunk contains information described in other
  814.                file formats (for example, an `RDIB' file or an ASCII text
  815.                file). The chunk fields are as follows:
  816.  
  817.  
  818.  
  819.                Field          Description
  820.  
  821.  
  822.                dwName         Specifies the cue point name.  This
  823.                               value must match one of the names
  824.                               listed in the <cue-ck> cue-point
  825.                               table.
  826.  
  827.                dwMedType      Specifies the file type contained in
  828.                               the fileData field. If the fileData
  829.                               section contains a RIFF form, the
  830.                               dwMedType field is the same as the
  831.                               RIFF form type for the file.
  832.  
  833.                               This field can contain a zero value.
  834.  
  835.                fileData       Contains the media file.
  836.