Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

tom76

Sound (.wav) in VC++

This topic is 6068 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How does sound work in VC++? What I mean is I''m playing with the donuts3D game off the sdk and decided to change the sounds. I replaced the .wav file with another one, and that didn''t work. I then changed the filename completely (say bangbang.wav to blownup.wav) and changed it all in the code itself, no errors etc., but when I play the game THE ORIGINAL SOUND (bangbang.wav) STILL PLAYS!!!!!!!! Even though there isn''t any other file named blownup.wav on my computer!!! Does VC++ store .wav files in hex format and generates them that way? I''ve seen hex relating to sound in the resources folder. HELP!!! "I envy you, who has seen it all" "And I, young sir, envy you, who have yet to see it for the first time..." - Daniel Glenfield 1st October 2001

Share this post


Link to post
Share on other sites
Advertisement
Try deleting all object files. Basicly, anything that isn''t the main project file (don''t know how this works in VC++), or a file with ".h" ".cpp" ".rc" etc. Also try doing a resource build or a full build (again, I am not exactly sure how this works in VC)


ANDREW RUSSELL STUDIOS
Looking for my webpage? Funny that... Me too!
Resist nes8bit :: Bow Down to Linux Communisum

Share this post


Link to post
Share on other sites
If you want to remove all intermediate files, select Clean from under the Build menu.

VC can occasionally be a bit arsey when changing resources - occasionally it will not register any amendments and so not rebuild the resource data. In this case, just change one of the resource properties ( ideally the name ), then change it back to the original.

The easiest way to change resources is to delete the original, remembering the resource ordinal name ( IDR_WAV_BANG ). Then, import the new resource and give it the same ordinal resource ID as the original.

Share this post


Link to post
Share on other sites
I''ll give that a try - thanks!!!!

"I envy you, who has seen it all"
"And I, young sir, envy you, who have yet to see it for the first time..."
- Daniel Glenfield
1st October 2001

Share this post


Link to post
Share on other sites
THANK YOU!!!!!!!!!!!!!!!!! I hit REBUILD ALL and it worked it''s magic. Thank you so much

Daniel

"I envy you, who has seen it all"
"And I, young sir, envy you, who have yet to see it for the first time..."
- Daniel Glenfield
1st October 2001

Share this post


Link to post
Share on other sites
So how do they get the sound to work in that example? I tried to do something similar (using the dsutil stuff) in a simple direct draw app, except it would just play a .wav file when you hit the enter key. Nothing works, the code builds fine but the app doesn''t play any sound. I haven''t found any other examples of using dsound in this type of app (the only other examples are dialog based MFC Apps). Hoping to find an example of this, as opposed to spending too much time reinventing something that''s been done before?

"A man can''t just sit around." ''Lawn Chair'' Larry Walters (1982)

Share this post


Link to post
Share on other sites
Hmmm...not sure if I fully understand. Donuts uses the PlaySound function, which you can insert all over the place (it''s easy enough).
If you''re trying to put sound in, make sure it''s in the right part of the code. Maybe at the start of a function.

If that''s not helpful ask again lol

"I envy you, who has seen it all"
"And I, young sir, envy you, who have yet to see it for the first time..."
- Daniel Glenfield
1st October 2001

Share this post


Link to post
Share on other sites
tom76-The version of that demo I''ve got uses DirectSound and dsutil.h, dsutil.c. After reading your post I looked up something in a book and saw an App that used PlaySound(). Couldn''t believe it was that simple! Why would I bother with DirectSound?

"A man can''t just sit around." ''Lawn Chair'' Larry Walters (1982)

Share this post


Link to post
Share on other sites
Glad I could help - Now I''m having trouble with getting sounds to play!!!
I copied the source code across to a brand new project, but the sound won''t play (there are no errors reported, but the sound just doesn''t play). It''s annoying me very much!!!

"I envy you, who has seen it all"
"And I, young sir, envy you, who have yet to see it for the first time..."
- Daniel Glenfield
1st October 2001

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!