DirectX DSK playsound sample

I'm looking for something close to that. But I don't want to open the filepath through a openfiledialog. I just want to play a sound from Propertries.Resources and then another one from also Properties.Resources. Can someone help me and tell what I should change about the code so I shouldn't select it from the openfiledialog?

Your help is much appreciated!

privatevoid btnSoundfile_Click(object sender, System.EventArgs e)

{

OpenFileDialog ofd =newOpenFileDialog();

ofd.InitialDirectory = PathSoundFile;

ofd.Filter="Wave files(*.wav)|*.wav";

// Stop the sound if it's already playing before you open the the dialog

if (ApplicationBuffer !=null)

{

ApplicationBuffer.Stop();

}

if(DialogResult.Cancel == ofd.ShowDialog() )

return;

if(LoadSoundFile(ofd.FileName))

{

PathSoundFile =Path.GetDirectoryName(ofd.FileName);

lblFilename.Text =Path.GetFileName(ofd.FileName);

EnablePlayUI(true);

}

else

{

lblFilename.Text ="Could not create sound buffer.";

EnablePlayUI(false);

}

}

=> for more code check the DirectX SDK Samples folder by PlaySound.

Thank you!

[2426 byte] By [Fata1Attack] at [2007-12-23]