type
TForm1 = class(TForm)
ACMDialog1: TACMDialog;
ACMWaveIn1: TACMWaveIn;
ACMWaveOut1: TACMWaveOut;
Button1: TButton;
Button2: TButton;
UDPSock1: TUDPSock;
Edit1: TEdit;
Wallpaper1: TWallpaper;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure ACMWaveIn1Data(data: Pointer;
size: Integer);
procedure UDPSock1Recv(data: PChar;
delka: Integer;
host: String);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var format
ointer;
begin
UDPsock1.RemoteIP:=edit1.text;
format:=ACMDialog1.OpenDialog;
if format=nil then
exit;
UDPSock1.Start;
ACMWaveOut1.Open(format);
ACMWaveIn1.Open(format);
Button1.Enabled:=false;
Button2.Enabled:=true;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ACMWaveIn1.Close;
ACMWaveOut1.Close;
UDPSock1.Stop;
Button1.Enabled:=true;
Button2.Enabled:=false;
end;
procedure TForm1.ACMWaveIn1Data(data: Pointer;
size: Integer);
begin
UDPSock1.Send(data,size);
end;
procedure TForm1.UDPSock1Recv(data: PChar;
delka: Integer;
host: String);
begin
ACMWaveOut1.PlayBack(data,delka);
end;