June 2003
Intermediate to advanced
800 pages
34h 20m
English
You need to play a .wav audio file.
Use the unmanaged sndPlaySoundA API function.
The .NET Framework doesn’t include any managed classes for playing audio files. However, the winmm.dll library included with Windows includes a function named sndPlaySoundA that accepts the name of a WAV file and a parameter indicating how to play it. You can choose to play a sound synchronously, asynchronously, or in a continuous background loop. When you play a sound synchronously, the function interrupts the execution of the program until the sound is complete. If you play a sound asynchronously, the function will return immediately, and the sound will play in the background.
The following example form allows a sound to be ...
Read now
Unlock full access