User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 456,507 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,661 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 2398 | Replies: 19
Reply
Join Date: Sep 2007
Posts: 11
Reputation: eeneilson is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
eeneilson eeneilson is offline Offline
Newbie Poster

How do you include sound files in C++?

  #1  
Sep 27th, 2007
How do you incorperate sound files into a C++ program?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Posts: 11
Reputation: eeneilson is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
eeneilson eeneilson is offline Offline
Newbie Poster

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

  #2  
Sep 27th, 2007
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
Reply With Quote  
Join Date: Sep 2007
Posts: 11
Reputation: eeneilson is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
eeneilson eeneilson is offline Offline
Newbie Poster

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

  #3  
Sep 27th, 2007
Anyone?
Reply With Quote  
Join Date: Apr 2004
Location: Tracy
Posts: 744
Reputation: Killer_Typo will become famous soon enough Killer_Typo will become famous soon enough 
Rep Power: 7
Solved Threads: 32
Killer_Typo's Avatar
Killer_Typo Killer_Typo is offline Offline
Master Poster

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

  #4  
Sep 27th, 2007
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
!!!!! WARNING YOUR COMPUTER MAY BE INFECTED WITH SPYWARE!!!! PAY AN OVER PRICED AMMOUNT TO HAVE SOMTHING FIXED WE PLACED THERE IN THE FIRST PLACE!!!!!!!!!

sound familiar, know how to block yourself and keep yourself clean.
_____________________
http://www.lavasoftusa.com/ -->adaware
http://www.safer-networking.org/en/index.html -->spybot S&D
http://www.javacoolsoftware.com/spywareblaster.html -->spywareblaster
http://www.javacoolsoftware.com/spywareguard.html -->spywareguard
_____________________
and dont forget to spread the reputation to those that deserve!
Reply With Quote  
Join Date: Jun 2007
Location: Home
Posts: 2,451
Reputation: zandiago is on a distinguished road 
Rep Power: 6
Solved Threads: 24
Featured Poster
zandiago's Avatar
zandiago zandiago is offline Offline
Nearly a Posting Maven

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

  #5  
Sep 27th, 2007
I've always thought about this too....but if you need different colour text..i think you could use "
#define yl system("color 0e");".
Reply With Quote  
Join Date: Jun 2007
Location: Home
Posts: 2,451
Reputation: zandiago is on a distinguished road 
Rep Power: 6
Solved Threads: 24
Featured Poster
zandiago's Avatar
zandiago zandiago is offline Offline
Nearly a Posting Maven

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

  #6  
Sep 27th, 2007
Reply With Quote  
Join Date: Sep 2007
Posts: 11
Reputation: eeneilson is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
eeneilson eeneilson is offline Offline
Newbie Poster

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

  #7  
Sep 27th, 2007
Originally Posted by Killer_Typo View Post
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.
Reply With Quote  
Join Date: Sep 2007
Posts: 11
Reputation: eeneilson is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
eeneilson eeneilson is offline Offline
Newbie Poster

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

  #8  
Sep 27th, 2007
Originally Posted by zandiago View Post
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.
Reply With Quote  
Join Date: Sep 2007
Posts: 11
Reputation: eeneilson is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
eeneilson eeneilson is offline Offline
Newbie Poster

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

  #9  
Sep 27th, 2007
Originally Posted by zandiago View Post
Try this: http://www.daniweb.com/code/snippet190.html


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

Ok for this do I just change the "the_file" to the name of my wave file?
Reply With Quote  
Join Date: Sep 2007
Posts: 11
Reputation: eeneilson is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
eeneilson eeneilson is offline Offline
Newbie Poster

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

  #10  
Sep 28th, 2007
Um? sorry if im being impatent but are you guys still here?
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 3:43 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC