怎么用mediaplayer播放mp3啊? (100分)

  • 主题发起人 主题发起人 oulin
  • 开始时间 开始时间
O

oulin

Unregistered / Unconfirmed
GUEST, unregistred user!
怎么用来mediaplayer播放mp3啊?


 
你是98系统吧,那有装MP3解码.
2000就不需.
 
我装的是2000啊
 
设置文件名
MediaPlayer1.Filename
 
MediaPlayer1.Close;
MediaPlayer1.FileName:=播放文件名;
MediaPlayer1.Open;
MediaPlayer1.Play;
 
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, MPlayer;

type
TForm1 = class(TForm)
MediaPlayer1: TMediaPlayer;
Button1: TButton;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;


var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin

if OpenDialog1.Execute then

begin

MediaPlayer1.FileName:=OpenDialog1.FileName;
MediaPlayer1.Open;
end;

end;


end.
 
恩,版本要高点,我说的是Tmediaplayer
 
后退
顶部