Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How i can play a .WAV file in my mfc aplication?

Status
Not open for further replies.

vlitzer

Programmer
Apr 30, 2002
31
AR
Anyone know how to do it?
 
I just did this tonight, what a co-incindence. Use PlayFile(path, 0, SND_FILENAME) where path is the path of your file or a varible set to the path. You have to include the header file and the correct library, and this can be found by entering the function like I have above, then pressing f1 when your cursor is over PlayFile. I would write it but I'm not at my computer right now, I'm at a different comp. MyCode was:

CString Path = "D:\\Data Files\\doh.wav";
PlayFile(Path, 0, SND_FILENAME);

Its that easy, the \ symbol is a backslash.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top