You might struggle to play a .WAV file from a resource file, they're generally pretty big, but here's the basic idea which will work for extracting any type of file from a resource file. You can't play the WAV file directly while it's in memory (or maybe you can but I haven't a clue how), so store it in a .WAV file first:
Dim WAVFile() as Byte
ReDim WAVFile(0)
WAVFile = LoadResData("WAVHandleInResourceFile", "CUSTOM"
Open "c:\wavfile.wav" For Binary Access Write As 1
Put #1, 1, WAVFile
Close 1
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.