


To add audio files to the solution, open the Resources.resx file shown in the solution explorer. The example was written using Visual Studio 2005 using C# open the solution into the IDE to examine the code. The project contains only the default references for a win forms application the resources indicated were embedded into the application Resources and are not delivered with the application through an installation. The project is described in the solution explorer (figure 2). The solution provided with this download contains a single project entitled, "PlayWavFiles". Demonstration Form in Sample Application Getting Started. At the same time, the use of embedded resources precludes the potential for such files being moved or deleted after the consuming application has been installed.įigure 1. The audio files used were embedded into the application as resources which eliminates the need to package up external WAV files for installations requiring the presentation of audio files.

Due to the use of the System.Media class library, this example does not rely upon the import of the "winmm.dll" in order to play the audio file and for that reason this approach requires far less code to implement. This article describes an approach to embedding WAV audio files into an application and playing them through the use of the System.Media class library.
