delphi MediaPlayer循环播放MP3所有音乐文件问题?

即:在一个文件夹里装有20首MP3音乐文件,如何用MediaPlayer循环播放该文件夹里面的所有内容。
最新回答
良辰未赏透

2024-09-25 02:54:03

MediaPlayer用得不多, 只知道这种办法, . 假如你已有一个ListBox1并已经装载好全部MP3的完整路径信息了, 可以加一个TIMER1, 在 TIMER1的事件里写代码跟踪播放器的模式, 一停止即播放下一首歌.procedure TForm1.Timer1Timer(Sender: TObject);
begin
if MediaPlayer1.Mode=mpStopped then
begin
ListBox1.itemindex:=ListBox1.itemindex+1;
MediaPlayer1.FileName:=ListBox1.Items[ListBox1.itemindex];
MediaPlayer1.Close;
MediaPlayer1.Open;
MediaPlayer1.Play;。
北港不夏

2024-09-25 00:19:56

MediaPlayer用得不多, 只知道这种办法, 希望能帮到你. 假如你已有一个ListBox1并已经装载好全部MP3的完整路径信息了, 可以加一个TIMER1, 在 TIMER1的事件里写代码跟踪播放器的模式, 一停止即播放下一首歌.procedure TForm1.Timer1Timer(Sender: TObject);
begin
if MediaPlayer1.Mode=mpStopped then
begin
ListBox1.itemindex:=ListBox1.itemindex+1;
MediaPlayer1.FileName:=ListBox1.Items[ListBox1.itemindex];
MediaPlayer1.Close;
MediaPlayer1.Open;
MediaPlayer1.Play;
end;
end;