C
cqpipilu
Unregistered / Unconfirmed
GUEST, unregistred user!
我用realaudio控件写一个播放器,但realaudio1.GetLength为什么是0???
代码如下:
procedure TForm1.DsFancyButton1Click(Sender: TObject);
begin
if opendialog1.Execute then begin
realaudio1.Source:=opendialog1.FileName;
trackbar1.Max:=realaudio1.Getlength div 1000;
realaudio1.DoPlay;
timer1.Enabled:=true;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
trackbar1.Position:=realaudio1.GetPosition div 1000;
end;
代码如下:
procedure TForm1.DsFancyButton1Click(Sender: TObject);
begin
if opendialog1.Execute then begin
realaudio1.Source:=opendialog1.FileName;
trackbar1.Max:=realaudio1.Getlength div 1000;
realaudio1.DoPlay;
timer1.Enabled:=true;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
trackbar1.Position:=realaudio1.GetPosition div 1000;
end;