关于播放时间的问题(100分)

  • 主题发起人 wp231957
  • 开始时间
W

wp231957

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button2Click(Sender: TObject);
var
ltime:double;
lh,lm,ls :integer;
i:integer;
s:string;
s2:array [0..1024] of char;
begin

s:=filelistbox1.Items[filelistbox1.itemindex];
//用鼠标选中文件列表框中MP3文件
GetShortPathName(PChar(S),s2,sizeof(s2));
//获取短文件名
realaudio11.Source :=s2;
realaudio11.DoPlay ;
messagebox(0,'已经开始播放了','kill',0);
//这里添加这个语句后 可以获取RM 的播放总时间 ,但是加其他语句就不行 比如 SLEEP 空循环等 ,没办法,只好又加了一个TIMER控件 把这个MESSAGEBOX 杀死
ltime:=realaudio11.GetLength/1000;
//获取长度
lh:=trunc(ltime) div 3600;
//获取小时数
lm:=trunc(ltime-lh*3600) div 60;
//获取分钟数
ls:=trunc(ltime)-lh*3600-lm*60;
//获取秒数
showmessage(format('%d : %d : %d',[lh,lm,ls]));
end;


procedure TForm1.Timer1Timer(Sender: TObject);
begin

sendmessage(findwindow(nil,'kill'),wm_close,0,0);
end;
 
无人问津啊
 
试试
RealAudio11.GetLength;
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
930
import
I
I
回复
0
查看
638
import
I
顶部