The DirectSound and DirectSoundCapture APIs do not include methods for handling wave files. However, the source code for several of the sample applications includes a handy file, Wave.c, which contains functions for opening and creating a wave file, reading and writing the file headers, and streaming data to or from the file.
Wave files are in the Resource Interchange File Format (RIFF), which consists of a variable number of "chunks" containing either header information (for example, the wave format of sound samples) or data (the samples themselves). The Win32 API supplies functions for opening and closing RIFF files, seeking chunks, and so on. These functions, whose names all start with "mmio," are used by the wrapper functions in the Wave.c file.
More information about using the wrapper functions is given in the following two topics: