Is there anyway to include a wave file in an exe?
I mean, to play a wave file, without having to
having it as a seperate file...
Printable View
Is there anyway to include a wave file in an exe?
I mean, to play a wave file, without having to
having it as a seperate file...
Yes. There are two ways. One is to have a textbox, and set its text to the data of the WAV file. Y'know, whenever you open a WAV in Notepad you get all that gibberish crap... Just take it and dump it into a file, use it like normal with the PlaySound API or whatever, and delete it when the program ends.
The othwer way is a little more intricate (but you're forced to use it if your WAV is bigger than 64k) and involves embedding the WAV directly on a form with an OLE control. Then you can 'reconstruct' the embedded file. The problem is I can't remember how to do that for the life of me... I'll bet it's in the VB help file somewhere.
~Zero the Inestimable