錄音程式範例(不用任何元件) |
|
領航天使
站長 發表:12216 回覆:4186 積分:4084 註冊:2001-07-25 發送簡訊給我 |
用Delphi 6.0寫的錄音程式,
有Source&ExeFile,
不用元件採用mmsystem的mciSendString,
感謝會員RU提供參考資料,請見:http://delphi.ktop.com.tw/topic.php?topic_id=21581 原始程式碼很短,我列出來給大家參考:
unit Unit1; interface uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,mmsystem, StdCtrls; type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button4: TButton;
SaveDialog1: TSaveDialog;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; var
Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject);
begin
mciSendString('close p1',0,0,0);
mciSendStringA('open new type WAVEAudio alias p1',0,0,0);
mciSendString('record p1',0,0,0);
end; procedure TForm1.Button2Click(Sender: TObject);
begin
mciSendString('stop p1',0,0,0);
end; procedure TForm1.Button3Click(Sender: TObject);
begin
mciSendString('play p1',0,0,0);
end; procedure TForm1.Button4Click(Sender: TObject);
var s:string;
begin
if SaveDialog1.Execute then
s:='save p1 ' SaveDialog1.filename;
mciSendString(pchar(s),0,0,0);
end; end. ~~~Delphi K.Top討論區站長~~~
------
~~~Delphi K.Top討論區站長~~~
附加檔案:27036_wavrec.zip
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |