but am finding it a little tricky and there no demo on how to stream via internet but I done some thing like this as a example of my idea
Send data to server
Code: Select all
procedure TForm1.RVMicrophone1GetAudio(Sender: TObject; AStream: TMemoryStream;
var ADataSize: Integer; const AAudioIndex: Word; var AStartTime,
ADuration: Cardinal; var ASamplesPerSec: TRVSamplesPerSec;
var ABitsPerSample: TRVBitsPerSample; var AChannels: Integer);
begin
AStream.Position := 0;
WSocket1.Send(AStream, AStream.Size); // send to overbyte socket server
end;
Code: Select all
procedure TForm1.WSocketServer1DataAvailable(Sender: TObject; ErrCode: Word);
var
AStream: TMemoryStream;
begin
AStream := TMemoryStream.Create();
WSocketServer1.Receive(AStream, AStream.Size);
AStream.Position := 0;
WSocketServer1.Client[0].Send(AStream, AStream.Size); // sent to overbyte client scoket
end;
Code: Select all
procedure TForm1.WSocket1DataAvailable(Sender: TObject; ErrCode: Word);
var
AStream: TMemoryStream;
begin
AStream := TMemoryStream.Create();
WSocket1.Receive(AStream, AStream.Size);
AStream.Position := 0;
RVAudioPlayer1.PlayAudio(AStream,AStream.Size); // add to player so clients can hear incoming audio
end;