我的程序在 C# 中使用 windows 媒体播放器,因此我可以播放几乎任何声音文件。有些声音需要一个接一个地连续播放。我能想到的唯一方法是使用播放列表,但我不知道如何在调用 windows 媒体播放器之间清除播放列表。
如何在 Windows 媒体播放器中一个接一个地播放声音,而不会遇到以前播放列表的问题?
谢谢
我的代码:
WMPLib.IWMPPlaylist playlist = axWindowsMediaPlayer1.playlistCollection.newPlaylist("myplaylist");
WMPLib.IWMPMedia media;
foreach (string question in questionURL)
{
media = axWindowsMediaPlayer1.newMedia(question);
playlist.appendItem(media);
media = axWindowsMediaPlayer1.newMedia(answer);
playlist.appendItem(media);
axWindowsMediaPlayer1.currentPlaylist = playlist;
axWindowsMediaPlayer1.Ctlcontrols.play();
axWindowsMediaPlayer1.playlistCollection.remove(playlist);\\one of my many failed attempts at clearing the playlist. It doesn't throw an error, it doesn't clear the playlist either.
}