[Help] with Overbyte with RVMedia and streaming microphone data to all connected clients.
Posted: Sun Jan 13, 2019 1:56 am
OK am trying to work out away to use overbyte to stream the audio data from RVMicrophone and then replace it back using RVAudioPlayer on the other clients.
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
Server gets data and then send it back to client
Client plays back the audio
now all that code is just a mock up and more then likely will not work but it gives you a general understanding what am after. and sorry for any bad spelling
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;