制作MP3,小问题,帮帮忙。 ( 积分: 33 )

  • 主题发起人 主题发起人 701004158
  • 开始时间 开始时间
7

701004158

Unregistered / Unconfirmed
GUEST, unregistred user!
MP3小程序,源码如下:<br>unit main;<br>interface<br>uses<br> &nbsp;Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> &nbsp;Dialogs, StdCtrls, Menus, ComCtrls, ExtCtrls, MPlayer;<br>type<br> &nbsp;Tfrm_main = class(TForm)<br> &nbsp; &nbsp;MediaPlayer1: TMediaPlayer;<br> &nbsp; &nbsp;Timer1: TTimer;<br> &nbsp; &nbsp;Image1: TImage;<br> &nbsp; &nbsp;OpenDialog1: TOpenDialog;<br> &nbsp; &nbsp;MainMenu1: TMainMenu;<br> &nbsp; &nbsp;TrackBar1: TTrackBar;<br> &nbsp; &nbsp;TrackBar2: TTrackBar;<br> &nbsp; &nbsp;StatusBar1: TStatusBar;<br> &nbsp; &nbsp;N1: TMenuItem;<br> &nbsp; &nbsp;N2: TMenuItem;<br> &nbsp; &nbsp;N3: TMenuItem;<br> &nbsp; &nbsp;Label1: TLabel;<br> &nbsp; &nbsp;N4: TMenuItem;<br> &nbsp; &nbsp;N5: TMenuItem;<br> &nbsp; &nbsp;N6: TMenuItem;<br> &nbsp; &nbsp;N7: TMenuItem;<br> &nbsp; &nbsp;N8: TMenuItem;<br> &nbsp; &nbsp;N9: TMenuItem;<br> &nbsp; &nbsp;N10: TMenuItem;<br> &nbsp; &nbsp;N11: TMenuItem;<br> &nbsp; &nbsp;Label2: TLabel;<br> &nbsp; &nbsp;procedure N4Click(Sender: TObject);<br> &nbsp; &nbsp;procedure N5Click(Sender: TObject);<br> &nbsp;private<br> &nbsp; &nbsp;{ Private declarations }<br> &nbsp;public<br> &nbsp; &nbsp;{ Public declarations }<br> &nbsp;end;<br>var<br> &nbsp;frm_main: Tfrm_main;<br>implementation<br>{$R *.dfm}<br>procedure Tfrm_main.N4Click(Sender: TObject);<br>begin<br> &nbsp;if opendialog1.Execute then<br> &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp;mediaplayer1.FileName := opendialog1.FileName ;<br> &nbsp; &nbsp; &nbsp;try<br> &nbsp; &nbsp; &nbsp; &nbsp;mediaplayer1.Open ;<br> &nbsp; &nbsp; &nbsp;except<br> &nbsp; &nbsp; &nbsp; &nbsp;showmessage('you can not open it!');<br> &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp;statusbar1.Panels[1].Text :='file time is:'+ inttostr(trackbar1.Max);<br> &nbsp; &nbsp;end; &nbsp; &nbsp; &nbsp; <br>end;<br><br>procedure Tfrm_main.N5Click(Sender: TObject);<br>begin<br> &nbsp;mcisendstring('set all audio all on',nil,0,handle);<br> &nbsp;//////////////////////////////////////////////////老是提示:mcisendstring未定义。怎么办?(mcisendstring为API函数)<br>end;<br><br>end.
 
MP3小程序,源码如下:<br>unit main;<br>interface<br>uses<br> &nbsp;Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> &nbsp;Dialogs, StdCtrls, Menus, ComCtrls, ExtCtrls, MPlayer;<br>type<br> &nbsp;Tfrm_main = class(TForm)<br> &nbsp; &nbsp;MediaPlayer1: TMediaPlayer;<br> &nbsp; &nbsp;Timer1: TTimer;<br> &nbsp; &nbsp;Image1: TImage;<br> &nbsp; &nbsp;OpenDialog1: TOpenDialog;<br> &nbsp; &nbsp;MainMenu1: TMainMenu;<br> &nbsp; &nbsp;TrackBar1: TTrackBar;<br> &nbsp; &nbsp;TrackBar2: TTrackBar;<br> &nbsp; &nbsp;StatusBar1: TStatusBar;<br> &nbsp; &nbsp;N1: TMenuItem;<br> &nbsp; &nbsp;N2: TMenuItem;<br> &nbsp; &nbsp;N3: TMenuItem;<br> &nbsp; &nbsp;Label1: TLabel;<br> &nbsp; &nbsp;N4: TMenuItem;<br> &nbsp; &nbsp;N5: TMenuItem;<br> &nbsp; &nbsp;N6: TMenuItem;<br> &nbsp; &nbsp;N7: TMenuItem;<br> &nbsp; &nbsp;N8: TMenuItem;<br> &nbsp; &nbsp;N9: TMenuItem;<br> &nbsp; &nbsp;N10: TMenuItem;<br> &nbsp; &nbsp;N11: TMenuItem;<br> &nbsp; &nbsp;Label2: TLabel;<br> &nbsp; &nbsp;procedure N4Click(Sender: TObject);<br> &nbsp; &nbsp;procedure N5Click(Sender: TObject);<br> &nbsp;private<br> &nbsp; &nbsp;{ Private declarations }<br> &nbsp;public<br> &nbsp; &nbsp;{ Public declarations }<br> &nbsp;end;<br>var<br> &nbsp;frm_main: Tfrm_main;<br>implementation<br>{$R *.dfm}<br>procedure Tfrm_main.N4Click(Sender: TObject);<br>begin<br> &nbsp;if opendialog1.Execute then<br> &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp;mediaplayer1.FileName := opendialog1.FileName ;<br> &nbsp; &nbsp; &nbsp;try<br> &nbsp; &nbsp; &nbsp; &nbsp;mediaplayer1.Open ;<br> &nbsp; &nbsp; &nbsp;except<br> &nbsp; &nbsp; &nbsp; &nbsp;showmessage('you can not open it!');<br> &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp;statusbar1.Panels[1].Text :='file time is:'+ inttostr(trackbar1.Max);<br> &nbsp; &nbsp;end; &nbsp; &nbsp; &nbsp; <br>end;<br><br>procedure Tfrm_main.N5Click(Sender: TObject);<br>begin<br> &nbsp;mcisendstring('set all audio all on',nil,0,handle);<br> &nbsp;//////////////////////////////////////////////////老是提示:mcisendstring未定义。怎么办?(mcisendstring为API函数)<br>end;<br><br>end.
 
uses MMSystem;
 
uses MMSystem
 
楼上的都说对了<br>有关MCI方面的函数大部分都出自MMSystem吧<br>
 
uses MMSystem
 
后退
顶部