G
Gingerzy
Unregistered / Unconfirmed
GUEST, unregistred user!
我用一TrackBar控制播放一段wav声音,(如下)可播放出的声音拖动TrackBar时声音断断
续续,谢谢!!!!
procedure TFormMain.TrackBar1Change(Sender: TObject);
begin
MediaPlayer1.Pause;
MediaPlayer1.Position := TrackBar1.Position;
MediaPlayer1.Play;
end;
procedure TFormMain.Timer1Timer(Sender: TObject);
begin
TrackBar1.Min := 0;
TrackBar1.Max := MediaPlayer1.Length;
TrackBar1.Position := MediaPlayer1.Position;
end;
续续,谢谢!!!!
procedure TFormMain.TrackBar1Change(Sender: TObject);
begin
MediaPlayer1.Pause;
MediaPlayer1.Position := TrackBar1.Position;
MediaPlayer1.Play;
end;
procedure TFormMain.Timer1Timer(Sender: TObject);
begin
TrackBar1.Min := 0;
TrackBar1.Max := MediaPlayer1.Length;
TrackBar1.Position := MediaPlayer1.Position;
end;