mike_vio Posted June 29, 2011 Report Posted June 29, 2011 Cerea cineva pe forum un program dinasta, m-am gandit ca e folositor si pentru altii.unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, mmsystem;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Label1: TLabel; Label2: TLabel; Label3: TLabel; Button3: TButton; Timer1: TTimer; procedure Button3Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Timer1Timer(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button3Click(Sender: TObject);begin// iesirea din programApplication.Terminate;end;procedure TForm1.Button1Click(Sender: TObject);begin//porneste capturatimer1.Enabled:=True; mciSendString('OPEN NEW TYPE WAVEAUDIO ALIAS MicSound', nil, 0, Handle); mciSendString('SET MicSound TIME FORMAT MS ' + // set the time format 'BITSPERSAMPLE 8 ' + // 8 Bit 'CHANNELS 1 ' + // MONO 'SAMPLESPERSEC 8000 ' + // 8 KHz 'BYTESPERSEC 8000', // 8000 Bytes/s nil, 0, Handle); mciSendString('RECORD MicSound', nil, 0, Handle);end;procedure TForm1.Button2Click(Sender: TObject);begin//opreste captura si salveaza fisierul FileName.wav in calea unde e si programultimer1.Enabled:=false; mciSendString('STOP MicSound', nil, 0, Handle); mciSendString(PChar('SAVE MicSound ' + ExtractFilePath(Application.ExeName)+'FileName.wav'), nil, 0, Handle); mciSendString('CLOSE MicSound', nil, 0, Handle);end;procedure TForm1.Timer1Timer(Sender: TObject);begin// arata cate secunde se inregistreazaLabel2.Caption:=IntToStr(StrToInt(Label2.caption)+1);end;end.deci o forma cu 3 butoane, start + stop + iesireun timer care numara secundeleo eticheta care arata tipul scurs.Daca se doreste modul "stealth" se poate renunta la butoane, etichete, iar form1.show:=false 2 1 Quote
Oust Posted June 29, 2011 Report Posted June 29, 2011 Bravo, numai bun pentru Oust media player . Quote