Thanks to Neil Crosby.
This program uses reflection (System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream) to pull the embedded data out of the executable. For WAVs, it then uses the PlaySound function in winmm.dll to play the sound.
For MIDIs, the program writes the data into a temporary file. It then uses the mciSendString function in winmm.dll to play the file.
See the code for details.
|