iam using indy10 Udp client and server
i have problem with send buffer from the client to the server here is my code
Delphi-Quellcode:
procedure TForm1.recorderData(Sender: TObject; const Buffer: Pointer;
BufferSize: Cardinal; var FreeIt: Boolean);
begin
Freeit :=True;
if sendtocl.active then
sendtocl.SendBuffer(RawToBytes(Buffer^, Buffersize))
else
micstop.Caption := 'busy';
end;
server on read
Delphi-Quellcode:
procedure TForm1.UDPReceiverUDPRead(AThread: TIdUDPListenerThread;
const AData: TIdBytes; ABinding: TIdSocketHandle);
var
AudioDataSize: Integer;
AudioData : Pointer;
begin
try
EnterCriticalSection(Section);
try
AudioDataSize := Length(AData);
if AudioDataSize > 10
then
begin
try
if not Player.Active
then
begin
Player.Active := True;
Player.WaitForStart;
end;
except
end;
if BlockAlign > 1
then Dec(AudioDataSize, AudioDataSize
mod BlockAlign);
AudioData := AudioBuffer.BeginUpdate(AudioDataSize);
try
BytesToRaw(AData, AudioData^, AudioDataSize);
finally
AudioBuffer.EndUpdate;
end;
end else
begin
Player.Active := False;
Player.WaitForStop;
end;
finally
LeaveCriticalSection(Section);
end;
except
end;
end;
also iam trying to debug the project
i got
Erroneous_Type
on
Sendbuffer
and
RawToBytes
any help would suggested ?