I've created a simple card game using Windows form app. The only thing that I need to do is add music effects. I recorded some sounds (draw a card etc.) in mp3, added it to the game via WMPlib and everything works, except one thing. I want to play the music in the middle of a method, not after it ends - what do I mean is this:
private void Button_Click (object sender, EventArgs e)
{
//code of player 1
player.URL = @"draw a card.mp3";
//Immediatelly after that will play player 2
Player2();
}
void Player2()
{
//do stuff
System.Threading.Thread.Sleep(1000);
//do another stuff
player.URL = @"draw a card 2.mp3";
}
What happens is that both sounds are played together after the code ends. Is it possible to manage it somehow to play the first sound before the second method is called? Thanks much for any help ;)