|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
How to: Play a Sound Embedded in a Resource from a Windows Form
You can use the SoundPlayer class to play a sound from an embedded resource.
This example requires:
Importing the System.Media namespace.
Including the sound file as an embedded resource in your project.
Replacing "<AssemblyName>" with the name of the assembly in which the sound file is embedded. Do not include the ".dll" suffix.