Robinson Niit

Robinson Niit

  • NA
  • 2
  • 5.3k

C# - How to play an audio file after another finishes ?

Oct 8 2015 11:05 AM
Hi all!!
I want to play multiple audio file from a folder, but I only play the first file
This is my code :
List<string> wavlist = new List<string>();
wavlist.Add(Application.StartupPath + "\\mp3\\1.mp3");
wavlist.Add(Application.StartupPath + "\\mp3\\2.mp3");
wavlist.Add(Application.StartupPath + "\\mp3\\3.mp3");
wavlist.Add(Application.StartupPath + "\\mp3\\4.mp3");
foreach (string file in wavlist)
{
WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer();
wplayer.URL = file;
wplayer.control.play();
}
 
 Please help me!
@_@
Thanks and best regards.

Answers (1)