Quote Originally Posted by Darhazer
1) You can use playsound() API function to play external wave or wave which is build in your resource file. Problem is that you cannot build-in wave into the resource file; it is possible to do this with VC++
It is possible to do this IIRC, but you have to manually write the resource file script (a little pain). Create a text file with a .rc extension ("myfile.rc"). Enter the following sort-of-stuff into it:

my_wave_name WAVE moo.wav
my_other_wave WAVE somefile.wav
yet_another WAVE thirdsound.wav

...and so on.

Add this to your project: Project->Add To Project menu, and select the wanted .rc. Once you've done this, Delphi will compile the resource script into a .res and will link it to your exe automatically (no need for a $R if you do it this way). I'd suggest creating a .rc file for sounds only, and doing everything else in the Image Editor tool and a $R. Makes life easier!

Also, when you're linking .res resources, remember that *.res means "a res file with the same filename as the current unit", not "any and every resource file". Just in case you use multiple .res files, that's all...

You can then play the stuff with sndPlaySound/PlaySound -- e.g.,

PlaySound('my_wave_name', HInstance, SND_ASYNC or SND_RESOURCE or SND_LOOP);

Where the first parameter is the same as one of the names in the .rc file.

You might also want to investigate FMod and/or BASS -- I'd assume they have loading-from-resouce functions, though of course, I haven't used them yet...