Partager via


Using the PlaySound Function with Waveform Audio Files

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

In Windows Embedded CE, waveform audio files use the .wav file name extension. The following code example shows how to play the \Sounds\Bells.wav file.

PlaySound (TEXT("\\SOUNDS\\BELLS.WAV"), NULL, SND_SYNC);

If the specified file does not exist or the file cannot be stored in available device memory, the PlaySound function plays the default system sound. If you have not defined a default system sound, PlaySound fails without playing a sound. The following code example shows how to specify that the default sound should not be played, by using the SND_NODEFAULT flag in the fdwSound parameter to prohibit the application from playing the default sound.

PlaySound (TEXT("\\SOUNDS\\BELLS.WAV"), NULL, SND_SYNC | SND_NODEFAULT);

See Also

Concepts

Using the PlaySound Function