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.

I guess you got to some perform a close. See this example
Do not worry about the C++ markings. First code is in VB, second is in C#.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.