2
나는 C# .net에서 windows 미디어 플레이어 구성 요소를 사용하여 미디어 플레이어를 개발하려고합니다. 이것은 내가 재생 목록을 만들고 재생 목록에 노래를 추가 할 수있는 코드입니다. "playlistviewbar"라는 목록 상자에 재생 목록의 이름이 표시되고이 재생 목록을 현재 재생 목록으로 설정했습니다.재생 목록을 만들고 저장하는 방법
하지만 프로젝트를 실행하고 현재 plaulist가 설정 한 경우 플레이어와 일치하지 않는 미디어를 재생하도록 요청합니다. 확장자 "."가 있음을 보여줍니다.
: 그리고 여기WMPLib.IWMPPlaylist pl;
public WMPLib.IWMPMedia files1,paths1;
string playListName;
private void toolStripButton3_Click(object sender, EventArgs e)
{
if (listnametxt.Text == "")
{
playListName = "Untitled playlist";
}
else
{
playListName = listnametxt.Text;
}
pl = axWindowsMediaPlayer1.playlistCollection.newPlaylist(playListName);
playlistviewbar.Items.Add(playListName);
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string[] filestring=openFileDialog2.SafeFileNames;
string[] pathstring=openFileDialog2.FileNames;
for (int i = 0; i < filestring.Length; i++)
{
files1 = axWindowsMediaPlayer1.newMedia(filestring[i]);
paths1 = axWindowsMediaPlayer1.newMedia(pathstring[i]);
pl.appendItem(paths1);
axWindowsMediaPlayer1.currentPlaylist =pl;
}
}
}
이 솔루션을 사용하는 동안 이전 항목이 끝나기 전에 재생 목록의 다음 항목이 2 초 동안 재생된다는 것을 알게되었습니다. 그런 다음 다시 처음부터 두 번째 것을 재생합니다. 재생 목록의 다음 항목 재생을 2 ~ 3 초 지연시킬 수있는 방법이 있습니까? –
실제로 크로스 페이딩이라고하는 것이 있다는 것을 알고 있습니다. 오브젝트의 설정을 할 수 있다면 트릭이라고 생각합니다. 플레이어 자체를 사용하면 시간을 겹치게 설정할 수도 있습니다 ... –