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.