Partager via


Using the PlaySound Function with Waveform Audio Files (Windows CE 5.0)

Send Feedback

In Windows 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

Using the PlaySound Function

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.