How to play a sound file in c++. I am trying to make an alarm program. I've done everything but i need to play sound at certain time. please help..............
BibhutiAlmighty
0
Light Poster
Recommended Answers
Jump to PostIf using Windows:
`PlaySound("MyFile.wav", NULL, SND_FILENAME);` //or: `PlaySound("MyFile.wav", NULL, SND_FILENAME | SND_ASYNC);`
For linux you can play files by opening
/dev/dsp
and writing the file to it.You could also use
system
and callaplay
to play it.
All 4 Replies
BibhutiAlmighty
0
Light Poster
triumphost
120
Posting Whiz
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
Moschops
683
Practically a Master Poster
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.