I have an app that I need to play a wav file when a key or button pressed or clicked, I use the SoundPlayer class but when i try to play another wav file at the same time the one that was playing stops.
Is there a way to play multiple wav files at the same time? If its one could you please give me examples or tutorial?
Here's what I got so far:
private void pictureBox20_Click(object sender, EventArgs e)
{
if (label30.Text == "Waiting 15.wav")
{
MessageBox.Show("No beat loaded");
return;
}
using (SoundPlayer player = new SoundPlayer(label51.Text))
{
try
{
player.Play();
}
catch (FileNotFoundException)
{
MessageBox.Show("File has been moved." + "\n" + "Please relocate it now!");
}
}
}
Thanks!