Generating Four-Character Codes

You can use the mmioFOURCC macro or the mmioStringToFOURCC function to generate four-character codes. The following example uses mmioFOURCC to generate a four-character code for "WAVE".

FOURCC fourccID; 
. 
. 
. 
fourccID = mmioFOURCC('W', 'A', 'V', 'E'); 
 

The following example uses mmioStringToFOURCC to generate a four-character code for "WAVE".

FOURCC fourccID; 
. 
. 
. 
fourccID = mmioStringToFOURCC("WAVE", 0); 
 

The second parameter in mmioStringToFOURCC specifies flags 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 because four-character codes identifying file-extension names must be all uppercase.