Jump to content
Sign in to follow this  
Nedlinin

Background music in C++ programs..

Recommended Posts

Ok! Ive just started learning C++ for a class that I will be having next semester. figured getting an early start is the best way to go about it.

 

Anyways, Ive been messing around with it a bit and was wondering if there was a way to get a program to play background music during its running period. Im able to get the program to PLAY music, but while the music plays, no commands can be entered and nothing actually moves forward in the program until the short clip is finished.

 

I would like to able to play music at the same times commands are being entered.

 

Anyone have a quick and easy way for a newb to be able to do this?

Share this post


Link to post
Share on other sites
Spawn a second thread to run the music code, kill that thread when the main program finishes. :)

yep. best way to do it is with threads.

Share this post


Link to post
Share on other sites
Spawn a second thread to run the music code, kill that thread when the main program finishes. :)

 

Haha.. you make it sound so easy!

 

Mind giving me a quick tutorial on how I can do this? Or helping me find a nice website for a guide book on things such as this?

Share this post


Link to post
Share on other sites
Haha.. you make it sound so easy!

 

Mind giving me a quick tutorial on how I can do this? Or helping me find a nice website for a guide book on things such as this?

It is easy once you get the hang of it. :)

 

http://www.linuxselfhelp.com/HOWTO/C++Prog...g-HOWTO-18.html

 

EDIT: Here's some stuff I did a few years back, check out the threading labs from ECE 329: http://people.clemson.edu/~dbonnie/Web%20P...olio/Win32.html

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×