• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1641
  • Last Modified:

How to stream mic audio through network?

i want to stream mic-in audio through network
how to do it?
that i need to use?
0
selas
Asked:
selas
  • 4
1 Solution
 
Lee_NoverCommented:
lol .. 'you CAN check my example ..' :D
oh . the binaries are in the VoIP.zip file :) VoIP_src.zip are only the sources
0
 
alc4emy5tCommented:
Well you could use indy IdTCPClient IdTCPServer and the readstream writestream functions

procedure SendToServer;
var
  Client: TIdTCPClient;
  AudioStream: TMemoryStream;
begin
  AudioStream := TMemoryStream.Create;
 
  While Playing do
  begin
    AudioStream.Position := 0;
    ....Code to put Audio into stream...

   Client := TIdTCPClient.Create(nil);
   Client.Host := SERVER_HOST;
   Client.Port := SERVER_PORT;

   Client.WriteStream(AudioStream, True, True);
  end;
  AudioStream.Free;
end;

procedure OnExecute(AThread: TIdThread);
var
  AudioStream: TMemoryStream;
  iSize: Integer;
begin
  AudioStream := TMemoryStream.Create;
 
  iSize := AThread.Connection.ReadInteger;
  AThread.Connection.ReadStream(AudioStream, iSize);
 
  ...Code the move the streamed audio into a buffer..
  AudioStream.Free;
end;

Its probably not an ideal solution, but would do the job. you could tell to write directly to a audio buffer of type TMemoryStream and when the buffer reaches a predetermined size the player started reading from the buffer until the end is reached or the buffer is empty and it needs to wait
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Lee_NoverCommented:
alc4emy5t: you haven't checked my example :P
0
 
selasAuthor Commented:
//   ....Code to put Audio into stream...

what code should be to add mic audio to stream?

and i get error on -> While Playing do
0
 
Lee_NoverCommented:
my example for streaming audio is the exact thing he asked about .. a working example that's been used by many :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now