1
Answer

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

Photo of Robinson Niit

Robinson Niit

9y
1.2k
1
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)