Sound (.wav) in VC++

Started by
12 comments, last by tom76 22 years, 5 months ago
Unfortunately, no errors in compilation rarely means everything is gonna be fine come runtime. You should get in the habit of checking HRESULTS from all Win32 function calls - chances are the problem will manifest itself in these. VC++ tip of the day : If you, as nearly everyone does, return HRESULTs to hr ( although I guess any variable name will work ), you can get the text description of the HRESULT by typing hr,hr into the watch window when debugging - can be very useful.

When you copied the source across, did you also copy all the resources? And maintain the directory structure? Could be that the resource can''t be located in the new project file tree. I''d have thought that VC++ would have picked this up, but you never know ...
Advertisement
Thanks - I''ll take your advice on board.

It seems to be my lucky day today - got almost all xmas shopping done, got some cheap pokemon cards - no doubles, 1 rare hologram, and best of all THE SOUND NOW WORKS!!!

Here''s what I did.
In the resources I hit INSERT, called my Custom type "WAV" and created a blank file.
I imported a sound (flamethrower.wav) and it came under "WAVE". I copied the hex code into my blank file, renamed it "FLAMETHROWER" (with the "") and deleted the other file. And it works!!!!

Amazing!

"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
if (witisism == !witty) return to_hole
Sorry I've notice that you've been posting alot of request about
sound programming.

If you got the money maybe you should get a book call:
"A Programmer's Guide to Sound" by Tim Kientzle

It gots some sound theory as will has a bunch of source code in
C++ for loading and playing *.wav, *.mpeg, *.iff etc..., wave
samples and information on Fourier's mathically tranformations.


Anyways I'm finish saying whatever I had to say so continue about your business. whAHAHAHAHA!!!!!

Edited by - black marq on November 12, 2001 5:19:19 PM
Found a good tutorial on DirectSound programming at:
http://www.gametutorials.com/default.asp
Just what I was looking for, nothing complicated just something to use as a starting point.

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

This topic is closed to new replies.

Advertisement