944,103 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 6064
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
Sep 27th, 2007
0

How do you include sound files in C++?

Expand Post »
How do you incorperate sound files into a C++ program?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
eeneilson is offline Offline
11 posts
since Sep 2007
Sep 27th, 2007
0

Re: How do you include sound files in C++?

I dont know if it matters or not but im using microsoft visual studio 2005 for my compiler and my OS is Windows Xp home
Reputation Points: 10
Solved Threads: 0
Newbie Poster
eeneilson is offline Offline
11 posts
since Sep 2007
Sep 27th, 2007
0

Re: How do you include sound files in C++?

Anyone?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
eeneilson is offline Offline
11 posts
since Sep 2007
Sep 27th, 2007
0

Re: How do you include sound files in C++?

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
Reputation Points: 152
Solved Threads: 39
Master Poster
Killer_Typo is offline Offline
778 posts
since Apr 2004
Sep 27th, 2007
0

Re: How do you include sound files in C++?

I've always thought about this too....but if you need different colour text..i think you could use "
#define yl system("color 0e");".
Featured Poster
Reputation Points: 129
Solved Threads: 26
Nearly a Posting Maven
zandiago is offline Offline
2,463 posts
since Jun 2007
Sep 27th, 2007
0

Re: How do you include sound files in C++?

Featured Poster
Reputation Points: 129
Solved Threads: 26
Nearly a Posting Maven
zandiago is offline Offline
2,463 posts
since Jun 2007
Sep 27th, 2007
0

Re: How do you include sound files in C++?

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
Ok the site you gave me had this code one it.
BOOL PlaySound(
LPCSTR pszSound,
HMODULE hmod,
DWORD fdwSound
);

but I dont see where I insert the name of my sound file.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
eeneilson is offline Offline
11 posts
since Sep 2007
Sep 27th, 2007
0

Re: How do you include sound files in C++?

Click to Expand / Collapse  Quote originally posted by zandiago ...
I've always thought about this too....but if you need different colour text..i think you could use "
#define yl system("color 0e");".
um ok you lost me here why would I have to change the text color to add a sound file? Although I would like to know how to change the text color also with this code do I just change ("color 0e ") to the color I want?

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
eeneilson is offline Offline
11 posts
since Sep 2007
Sep 27th, 2007
0

Re: How do you include sound files in C++?

mciSendString("play the_file",NULL,0,NULL);

Ok for this do I just change the "the_file" to the name of my wave file?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
eeneilson is offline Offline
11 posts
since Sep 2007
Sep 28th, 2007
0

Re: How do you include sound files in C++?

Um? sorry if im being impatent but are you guys still here?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
eeneilson is offline Offline
11 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Sum of Series help
Next Thread in C++ Forum Timeline: Confusing Problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC