| | |
How do you include sound files in C++?
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
It can be tricky, there is a playSound function in C++ but it's not all that powerful so you may be best suited to look for a library to do that, or feel free to get your hands dirty with some DirectX.

http://msdn2.microsoft.com/en-us/library/ms712879.aspx

http://msdn2.microsoft.com/en-us/library/ms712879.aspx
Dont forget to spread the reputation to those that deserve!
•
•
Join Date: Sep 2007
Posts: 11
Reputation:
Solved Threads: 0
•
•
•
•
It can be tricky, there is a playSound function in C++ but it's not all that powerful so you may be best suited to look for a library to do that, or feel free to get your hands dirty with some DirectX.
http://msdn2.microsoft.com/en-us/library/ms712879.aspx
BOOL PlaySound(
LPCSTR pszSound,
HMODULE hmod,
DWORD fdwSound
);
but I dont see where I insert the name of my sound file.
•
•
Join Date: Sep 2007
Posts: 11
Reputation:
Solved Threads: 0
•
•
•
•
I've always thought about this too....but if you need different colour text..i think you could use "
#define yl system("color 0e");".
If so does C++ have built in colors that can be defined just by their name like in HTML or is there another method for defining colors? Hexidecimal codes or something.
In case you guys cant tell I'm fairly new to C++
. Last edited by eeneilson; Sep 27th, 2007 at 9:41 pm.
•
•
Join Date: Sep 2007
Posts: 11
Reputation:
Solved Threads: 0
mciSendString("play the_file",NULL,0,NULL);
Ok for this do I just change the "the_file" to the name of my wave file?
Ok for this do I just change the "the_file" to the name of my wave file?
![]() |
Similar Threads
- sound of a water drip (Windows NT / 2000 / XP)
- #include custom files (C++)
- How To Load Sound Files In C++ (C++)
- Sound Troubles (Windows 95 / 98 / Me)
- sound file switching (C)
- Please~~~ Need help including sound files in the form! (C#)
- Problems with Windows Script Encoder & #include directive (ASP)
- no sound when playing mp3 or wma files (Windows NT / 2000 / XP)
- Can you add pictures/sounds in a win32 console app? (C)
Other Threads in the C++ Forum
- Previous Thread: Sum of Series help
- Next Thread: Confusing Problem
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






