I've wasted 5 hours trying to figure out how to implement sound in my C++ program.

Started by
27 comments, last by boogyman19946 12 years, 11 months ago
I think there should be a Build menu on the task bar at the top, I believe there is an option to build/run the code (I haven't use that IDE in soooo long XD)

BTW, you'll have to have your code belonging to a project before you can compile it (project settings constitute compiler/linker settings and such).

Yo dawg, don't even trip.

Advertisement
Okay I got the project started, created a new .cpp and copied everything over.

I hit debug and I get an error:

Unable to start program 'c:\users\xxxx\documents\visualstudio2010\projects\dw1.1ported\release\dw1.1ported.exe'

system cannot find the specified file

ugh...what now?

Okay I got the project started, created a new .cpp and copied everything over.

I hit debug and I get an error:

Unable to start program 'c:\users\xxxx\documents\visualstudio2010\projects\dw1.1ported\release\dw1.1ported.exe'

system cannot find the specified file

ugh...what now?


EDIT: Working now, weird.

Let me test the game and see if everything is working...then I'll try to play the sound.
Try this.


[media]
[/media]



Hmmm, nevermind, seems you figured the UI out.
PlaySound(TEXT("yourfile.wav"), NULL, SND_FILENAME);

Question here:

Am I supposed to put something where it says text? ANd where it says "yourfile.wav" do I just put the directory path where the file can be found?

EDIT: Also can you guys recommend a resouce for adding libraries? Not sure where I add in winmm.lib?
TEXT() is a macro so it should stay like it is :) yourfile.wav I imagine is the path to the wav file so you should replace it with the directory.

Yo dawg, don't even trip.


TEXT() is a macro so it should stay like it is :) yourfile.wav I imagine is the path to the wav file so you should replace it with the directory.


Alright, I tried following this guide:

http://sfml-dev.org/tutorials/1.6/start-vc.php

To add a library to the project, but when I go there it says its been deprecated and now its in a user sheet....

What the heck does that mean?!

1. I've wasted 5 hours trying to figure out how to implement sound in my C++ program.
2. I've been learning a lot and having fun.

1. It was NOT a waste.
2. See??

-- Tom Sloper -- sloperama.com

is winmm.lib already included with C++, or do I have to download and add it seperately?

I know I'm almost there...just a little...more...!!

[quote name='boogyman19946' timestamp='1305393130' post='4810748']
TEXT() is a macro so it should stay like it is :) yourfile.wav I imagine is the path to the wav file so you should replace it with the directory.


Alright, I tried following this guide:

http://sfml-dev.org/....6/start-vc.php

To add a library to the project, but when I go there it says its been deprecated and now its in a user sheet....

What the heck does that mean?!
[/quote]

http://ctp.social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/137ab8bb-3296-40fa-a602-998bb6747829 This should be more helpful.

I believe you can open the project properties by right-clicking on your project and selecting the properties option from the drop down menu (I don't know how 2010 is organized. I'm trying to install it atm)

Yo dawg, don't even trip.

This topic is closed to new replies.

Advertisement