How to add sound or music in MFC application?
On some eventi want to play some bombing sound?
Say wav files
Printable View
How to add sound or music in MFC application?
On some eventi want to play some bombing sound?
Say wav files
in the msdn, look for playsound function
include in your project winmm.lib and
try {
!sndPlaySound("fileName")
}
catch (...)
{}
sndPlaySound() may be phased out. Use PlaySound instead.
If you already have the waveform in memory, then look
at the waveOutWrite() function (and the whole series
of related waveOut.. functions.
Hello can any body give a 2-3 line code help. How to use
Playsound function.
i am facing problem with HANDLE
I want to play a wave file added to recource
Add winmm.lib to the Linker->Input->Additional Dependencies like Vato said. Then,
#include "mmsystem.h"
::PlaySound("alarm.wav",0,SND_ASYNC);