Four-Character Codes

A four-character code is a 32-bit quantity representing a sequence of one to four ASCII alphanumeric characters, padded on the right with blank characters. The data type for a four-character code is FOURCC. Use the mmioFOURCC function to convert four characters to a four-character code. For example, to use a four-character code for WAVE:

            FOURCC   fccIOProc;

            fccIOProc = mmioFOURCC( 'W', 'A', 'V', 'E' ) ;

To convert a null-terminated string into a four-character code, use the mmioStringToFOURCC function. The following example also generates a four-character code for WAVE.

            FOURCC fccIOProc;

            fccIOProc = mmioStringToFOURCC("WAVE", 0);

The second parameter in mmioStringToFOURCC specifies options for converting the string to a four-character code. If you specify the MMIO_TOUPPER flag, mmioStringToFOURCC converts all alphabetic characters in the string to uppercase. This is useful when you need to specify a four-character code to identify a custom I/O procedure. (Four-character codes are case-sensitive.)


[Back: The MMCKINFO Data Structure]
[Next: Creating RIFF Chunks]