Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitlePlay an embedded sound file
KeywordsVB.NET, audio, MIDI, WAV, sound, embedded sound files
CategoriesMultimedia, Software Engineering
 
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.

 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated