To load the file from an embedded resource, you're going to need to use the
SoundPlayer.Stream[
^] property instead of the
SoundLocation
property.
SoundPlayer sesCal = new SoundPlayer();
sesCal.Stream = Properties.Resources.ResourceManager.GetStream("ses2.wav");
sesCal.Play();
NB: The
SoundPlayer.Play[
^] method returns immediately, and plays the sound on a background thread. If you want your code to wait until the sound has finished playing, which will block the UI, you would need to use the
SoundPlayer.PlaySync[
^] method.