Solved

send voice from clients to server and the vise versa

Posted on 2002-06-13
26
498 Views
Last Modified: 2010-04-04
Hi Friends
i have multi-cast application that send messages between multi users.The application work over(UDP protocol).i want to upgrade it to send voice between the users.i'm looking forwords for you to help me to send the voice from the server to the clients and the vise versa.
thank you very mutch.
  fayiz
0
Comment
Question by:shaza
  • 11
  • 8
  • 3
  • +3
26 Comments
 
LVL 2

Expert Comment

by:freshman3k
Comment Utility
Hello

Go to this website:
http://lakeofsoft.com/i_vc_info.html

They have the cheapest component for your purpose, just $29

Good Luck
0
 

Accepted Solution

by:
Ahmed1 earned 150 total points
Comment Utility
hi
  I found this source, that make voice chat over TCP try it.


//========================form=========================
object Form1: TForm1
  Left = 168
  Top = 108
  Width = 533
  Height = 372
  Caption = 'Voip Test'
  Color = clTeal
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  Position = poDesktopCenter
  OnCloseQuery = FormCloseQuery
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Button1: TSpeedButton
    Left = 368
    Top = 112
    Width = 89
    Height = 25
    Caption = 'connect'
    Glyph.Data = {
      76010000424D7601000000000000760000002800000020000000100000000100
      04000000000000010000120B0000120B00001000000000000000000000000000
      800000800000008080008000000080008000808000007F7F7F00BFBFBF000000
      FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00300000000000
      003337777777777777F330FFFFFFFFFFF033373F3F3F3F3F3733330F0F0F0F0F
      03333F7F737373737FFF0000FFFFFFF0000377773FFFFFF7777F0FF800000008
      FF037F3F77777773FF7F0F9FFFFFFFF000037F7333333337777F0FFFFFFFFFFF
      FF0373FFFFFFFFFFFF7330000000000000333777777777777733333000000000
      3333333777777777F3333330FFFFFFF033333337F3FFFFF7F3333330F00000F0
      33333337F77777F7F3333330F0AAE0F033333337F7F337F7F3333330F0DAD0F0
      33333337F7FFF7F7F3333330F00000F033333337F7777737F3333330FFFFFFF0
      33333337FFFFFFF7F33333300000000033333337777777773333}
    NumGlyphs = 2
    OnClick = Button1Click
  end
  object Label1: TLabel
    Left = 8
    Top = 16
    Width = 64
    Height = 15
    Caption = 'Connected to'
    Font.Charset = ANSI_CHARSET
    Font.Color = clNavy
    Font.Height = -12
    Font.Name = 'Times New Roman'
    Font.Style = [fsBold, fsItalic, fsUnderline]
    ParentFont = False
  end
  object SpeedButton1: TSpeedButton
    Left = 368
    Top = 144
    Width = 89
    Height = 25
    Caption = 'Disconnect'
    Glyph.Data = {
      76010000424D7601000000000000760000002800000020000000100000000100
      04000000000000010000120B0000120B00001000000000000000000000000000
      80000080000000808000800000008000800080800000C0C0C000808080000000
      FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00300000000000
      003338888888888888F330FFFFFFFFFFF033383F3F3F3F3F383339990F0F0F09
      99333F8F838383838FFF09999FFFFF99990388883FFFFFF8888F0F9999000999
      9F038F3F88888883FF8F0FF9999F999900038F8333333338888F0FFF9999999F
      FF0383FFFFFFFFFFFF8330000999990000333888888888888833333009999900
      3333333888888888F33333309999999033333338F3FFFFF8F333333999909999
      33333338F88888F8F333339999AAE99993333338F8F338F8F333399990DAD099
      99333338F8FFF8F8F3333999F00000F999933338F8888838F3333990FFFFFFF0
      99933338FFFFFFF8F33333300000000039933338888888883333}
    NumGlyphs = 2
    OnClick = SpeedButton1Click
  end
  object Label2: TLabel
    Left = 240
    Top = 16
    Width = 96
    Height = 15
    AutoSize = False
    Caption = '# Buffers to be send'
    Font.Charset = ANSI_CHARSET
    Font.Color = clNavy
    Font.Height = -12
    Font.Name = 'Times New Roman'
    Font.Style = [fsBold, fsItalic, fsUnderline]
    ParentFont = False
  end
  object Label3: TLabel
    Left = 240
    Top = 40
    Width = 114
    Height = 15
    Caption = '# Of buffers to be layed'
    Font.Charset = ANSI_CHARSET
    Font.Color = clNavy
    Font.Height = -12
    Font.Name = 'Times New Roman'
    Font.Style = [fsBold, fsItalic, fsUnderline]
    ParentFont = False
  end
  object SpeedButton2: TSpeedButton
    Left = 368
    Top = 224
    Width = 89
    Height = 25
    Caption = '  Quit'
    Glyph.Data = {
      76010000424D7601000000000000760000002800000020000000100000000100
      04000000000000010000130B0000130B00001000000000000000000000000000
      800000800000008080008000000080008000808000007F7F7F00BFBFBF000000
      FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
      3333333333FFFFF3333333333999993333333333F77777FFF333333999999999
      33333337777FF377FF3333993370739993333377FF373F377FF3399993000339
      993337777F777F3377F3393999707333993337F77737333337FF993399933333
      399377F3777FF333377F993339903333399377F33737FF33377F993333707333
      399377F333377FF3377F993333101933399377F333777FFF377F993333000993
      399377FF3377737FF7733993330009993933373FF3777377F7F3399933000399
      99333773FF777F777733339993707339933333773FF7FFF77333333999999999
      3333333777333777333333333999993333333333377777333333}
    NumGlyphs = 2
    OnClick = SpeedButton2Click
  end
  object Edit2: TEdit
    Left = 368
    Top = 8
    Width = 57
    Height = 21
    TabOrder = 0
  end
  object Edit3: TEdit
    Left = 368
    Top = 32
    Width = 57
    Height = 21
    TabOrder = 1
  end
  object NMemo: TMemo
    Left = 40
    Top = 80
    Width = 273
    Height = 249
    Font.Charset = ANSI_CHARSET
    Font.Color = clNavy
    Font.Height = -12
    Font.Name = 'Times New Roman'
    Font.Style = [fsBold, fsItalic]
    ParentFont = False
    TabOrder = 2
  end
  object RemoteHostEdit: TEdit
    Left = 80
    Top = 8
    Width = 137
    Height = 21
    TabOrder = 3
  end
  object CheckBox1: TCheckBox
    Left = 416
    Top = 304
    Width = 65
    Height = 17
    Caption = 'Transmit'
    Color = clTeal
    Font.Charset = ANSI_CHARSET
    Font.Color = clNavy
    Font.Height = -12
    Font.Name = 'Times New Roman'
    Font.Style = [fsBold, fsItalic, fsUnderline]
    ParentColor = False
    ParentFont = False
    TabOrder = 4
  end
  object ClientSocket1: TClientSocket
    Active = False
    ClientType = ctNonBlocking
    Port = 0
    OnLookup = Lookup
    OnConnecting = Connecting
    OnConnect = Connect
    OnDisconnect = Disconnect
    OnRead = Read
    OnWrite = Write
    OnError = Error
    Left = 376
    Top = 72
  end
  object ServerSocket1: TServerSocket
    Active = False
    Port = 0
    ServerType = stNonBlocking
    OnListen = Listen
    OnAccept = Accept
    OnClientConnect = Connect
    OnClientDisconnect = Disconnect
    OnClientRead = Read
    OnClientWrite = Write
    OnClientError = Error
    Left = 416
    Top = 72
  end
end

//====================unit1============================
unit Unit1;

interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, mmsystem, StdCtrls, OleCtrls{, SHDocVw}, ScktComp,
  Buttons;

const
  {The larger the size of the block the fewer blocks recorded}
  {per second and therefore the longer the delay between}
  {recording and playback}
  memBlockLength = 2700;
  {500 bytes at 11k/sec = delay of 500/800 of a second}
  {roughly a 20th}

type
  Tmemblock = array[0..memblocklength] of byte;
  PmemBlock = ^TmemBlock;

  TForm1 = class(TForm)
    Edit2: TEdit;
    Edit3: TEdit;
    ClientSocket1: TClientSocket;
    ServerSocket1: TServerSocket;
    NMemo: TMemo;
    RemoteHostEdit: TEdit;
    CheckBox1: TCheckBox;
    Button1: TSpeedButton;
    Label1: TLabel;
    SpeedButton1: TSpeedButton;
    Label2: TLabel;
    Label3: TLabel;
    SpeedButton2: TSpeedButton;
    procedure ConnectButtonClick(Sender: TObject);
    procedure Connect(Sender: TObject;
      Socket: TCustomWinSocket);
    procedure Connecting(Sender: TObject;
      Socket: TCustomWinSocket);
    procedure Disconnect(Sender: TObject;
      Socket: TCustomWinSocket);
    procedure Accept(Sender: TObject;
      Socket: TCustomWinSocket);
    procedure Error(Sender: TObject; Socket: TCustomWinSocket;
      ErrorEvent: TErrorEvent; var ErrorCode: Integer);
    procedure Read(Sender: TObject; Socket: TCustomWinSocket);
    procedure Write(Sender: TObject;
      Socket: TCustomWinSocket);
    procedure Lookup(Sender: TObject;
      Socket: TCustomWinSocket);
    procedure Listen(Sender: TObject; Socket: TCustomWinSocket);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
  private
    { Private declarations }
    HwaveIn:PHWaveIn;
    HWaveOut:PHWaveOut;
    close_invoked:boolean;
    in_count,out_count:integer;
    ActiveSocket: TCustomWinSocket;
    procedure InitSocket;
    procedure InitAudio;
    procedure CreateInBlock;
    procedure CreateOutBlock(memBlock: PmemBlock; size: Integer);
    procedure MMOutDone(var msg:Tmessage);message MM_WOM_DONE;
    procedure MMInDone(var msg:Tmessage);message MM_WIM_DATA;
    procedure CloseAudio;
    procedure NMsg(msg: String);
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  s:integer;
  server:string;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  InitSocket;
end;

procedure TForm1.InitAudio;
var
  WaveFormat:Pwaveformatex;
  i,j:integer;
begin
  s:=0;
  WaveFormat:=new(Pwaveformatex);
  WaveFormat.wFormatTag:=wave_format_pcm;
  waveformat.nChannels:=1;
  waveformat.nSamplesPerSec:=8000;
  waveformat.nAvgBytesPerSec:=8000;
  waveformat.nBlockAlign:=1;
  waveformat.wBitsPerSample:=8;
  waveformat.cbSize:=0;

  i:=waveOutOpen(nil,0,WaveFormat,0,0,WAVE_FORMAT_QUERY);
  if i<>0 then NMsg('Error: Play format not supported');

  i:=waveInOpen(nil,0,WaveFormat,0,0,WAVE_FORMAT_QUERY);
  if i<>0 then NMsg('Error: Record format not supported');

  HwaveOut:=new(PHwaveOut);
  i:=waveOutOpen(HWaveOut,0,WaveFormat,form1.handle,0,CALLBACK_WINDOW);
  if i<>0 then NMsg('Error: Problem creating play handle');

  HwaveIn:=new(PHwaveIn);
  i:=waveInOpen(HWaveIn,0,WaveFormat,form1.handle,0,CALLBACK_WINDOW);
  if i<>0 then NMsg('Error: Problem creating record handle');

  {these are the count of the number of blocks sent to}
  {the audio device}
  in_count:=0;
  out_count:=0;
  edit2.text:=inttostr(in_count);
  edit3.text:=inttostr(out_count);

  {need to add some buffers to the recording queue}
  {in case the messages that blocks have been recorded}
  {are delayed}
  for j:= 1 to 15 do
    CreateInBlock;

  {finally start recording}
  i:=waveInStart(HwaveIn^);
  if i<>0 then NMsg('Error: Start error');

  close_invoked:=false;
end;

procedure TForm1.CreateInBlock;
var
  Header:PWaveHdr;
  memBlock:PmemBlock;
  i:integer;

begin
  {make a new block}
  memBlock:=new(PmemBlock);

  Header:=new(PwaveHdr);

  with header^ do
  begin
    lpData:=Pointer(memBlock);
    dwBufferLength:=memblocklength;
    dwBytesRecorded:=0;
    dwUser:=0;
    dwFlags:=0;
    dwLoops:=0;
  end;

  {prepare the new block}
  i:=waveInPrepareHeader(HWaveIn^,Header,sizeof(TWavehdr));
  if i<>0 then NMsg('Error: In Prepare error');

  {add it to the buffer}
  i:=waveInAddBuffer(HWaveIn^,Header,sizeof(TWaveHdr));
  if i<>0 then NMsg('Error: Add buffer error');

  inc(in_count);
end;

procedure TForm1.CreateOutBlock(memBlock: PmemBlock; size: Integer);
var
  Header:PWaveHdr;
  i:integer;
begin
  {make a new block}
  Header:=new(PwaveHdr);
  with header^ do
  begin
    lpData:=Pointer(memBlock);
    dwBufferLength:=size;
    dwBytesRecorded:=0;
    dwUser:=0;
    dwFlags:=0;
    dwLoops:=0;
  end;

  {prepare it for play back}
  i:=waveOutPrepareHeader(HWaveOut^,Header,sizeof(TWavehdr));
  if i<>0 then NMsg('Error: Out Prepare error');

  {add it to the playback queue}
  i:=waveOutWrite(HWaveOut^,Header,sizeof(TWaveHdr));
  if i<>0 then NMsg('Error: Wave out error');

  inc(out_count);
end;

procedure TForm1.MMOutDone(var msg:Tmessage);
var
  Header:PWaveHdr;
// i:integer;
begin
//NMsg('MMOutDone');

  dec(out_count);
  {get the returned header}
  Header:=PWaveHdr(msg.lparam);
  waveOutUnPrepareHeader(HWaveOut^,Header,sizeof(TWavehdr));

  {free the memory}
  dispose(Header^.lpdata);
  dispose(Header);

  {if there's no more blocks being recorded}
  if (out_count=0) and close_invoked then
  begin
    WaveOutClose(HWaveOut^);
    HwaveOut:=nil;
  end;

(*  {if there's nothing more to do then close}
  if (in_count=0) and (out_count=0) then
    close; *)
end;

procedure TForm1.MMInDone(var msg:Tmessage);
var
  Header:PWaveHdr;
//  i:integer;
begin
//  NMsg('MMInDone');

  dec(in_count);
  {block has been recorded}
  Header:=PWaveHdr(msg.lparam);
  waveInUnPrepareHeader(HWaveIn^,Header,sizeof(TWavehdr));


  if CheckBox1.Checked then

    ActiveSocket.SendBuf(Pointer(Header.lpData)^,
Header.dwBufferLength);

//  PData := Pointer(Header.lpData);
  dispose(Header.lpData);
  dispose(Header);

  if not(close_invoked) then
  begin
    CreateInBlock;

    edit2.text:=inttostr(in_count);
    edit3.text:=inttostr(out_count);
  end;

  {if there's no more blocks being recorded}
  if (in_count=0) and close_invoked then
  begin
    WaveInClose(HWaveIn^);
    HwaveIn:=nil;
  end;

  (*{if there's nothing more to do then close}
  if (in_count=0) and (out_count=0) then
    close;  *)
end;

procedure TForm1.CloseAudio;
begin
  close_invoked:=true;

  {reset the output channel}
  if HWaveOut<> nil then
  begin
   WaveOutReset(HWaveOut^);
   waveoutclose(Hwaveout^);
     end;

  {reset the input channel}
  if HwaveIn<> nil then
  begin
  WaveInReset(HWaveIn^);
  waveinclose(Hwavein^);
  end;
end;

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose:
Boolean);
begin
  CloseAudio;
  CloseAudio;
  Canclose:=true;
end;


//=======================================================================


procedure TForm1.NMsg(msg: String);
begin
  NMemo.Lines.Add(msg);
end;

procedure TForm1.InitSocket;
begin
  NMemo.Clear;
  ServerSocket1.Port := 9999;
  try
    ServerSocket1.Open;
  except
    NMemo.Lines.Add('Port in use');
  end;
end;

procedure TForm1.ConnectButtonClick(Sender: TObject);
begin

       if ClientSocket1.Active then ClientSocket1.Active := False;
  if InputQuery('Computer to connect to', 'Address Name:', Server) then
    if Length(Server) > 0 then
      with ClientSocket1 do
      begin
         ClientSocket1.Port := 9999;
        Host := Server;
        Active := True;
        ClientSocket1.Host := RemoteHostEdit.Text;

      end;



end;

procedure TForm1.Connect(Sender: TObject;
  Socket: TCustomWinSocket);

  begin
  NMsg('Connect');
  Button1.Enabled := false;
  RemoteHostEdit.Text := Socket.RemoteHost;
end;

procedure TForm1.Connecting(Sender: TObject;
  Socket: TCustomWinSocket);
begin
  NMsg('Connecting');
end;

procedure TForm1.Disconnect(Sender: TObject;
  Socket: TCustomWinSocket);
begin
  NMsg('Disconnect');
  button1.Enabled := true;
  CloseAudio;
//  Close;
end;

procedure TForm1.Accept(Sender: TObject;
  Socket: TCustomWinSocket);
begin
  NMsg('Accept');
end;

procedure TForm1.Error(Sender: TObject;
  Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
  var ErrorCode: Integer);
begin
  case ErrorEvent of
    eeGeneral:    NMsg('General error');
    eeSend:       NMsg('Send error');
    eeReceive:    NMsg('Receive error');
    eeConnect:    NMsg('Connect error');
    eeDisconnect: NMsg('Disconnect error');
    eeAccept:     NMsg('Accept error');
  end;
  ErrorCode := 0;
end;

procedure TForm1.Read(Sender: TObject;
  Socket: TCustomWinSocket);
var
  len: Integer;
  data: PmemBlock;
begin
  len := Socket.ReceiveLength;
  if len > 0 then
  begin
    NMsg('Read: ' + IntToStr(len) + ' bytes received');
    data := new(pmemblock);
    Socket.ReceiveBuf(data^, len);
    CreateOutBlock(data, len);
  end;
end;

procedure TForm1.Write(Sender: TObject;
  Socket: TCustomWinSocket);
begin
  NMsg('Write');
  ActiveSocket := Socket;
  InitAudio;
end;

procedure TForm1.Lookup(Sender: TObject;
  Socket: TCustomWinSocket);
begin
  NMsg('Lookup');
end;

procedure TForm1.Listen(Sender: TObject; Socket: TCustomWinSocket);
begin
  NMsg('Listening for incoming calls....');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
     if ClientSocket1.Active then ClientSocket1.Active := False;
  if InputQuery('Computer to connect to', 'Address Name:', Server) then
    if Length(Server) > 0 then
      with ClientSocket1 do
      begin
         ClientSocket1.Port := 9999;
         Host := Server;
         Active := True;

       // ClientSocket1.Host := RemoteHostEdit.Text;

        end;

    { ClientSocket1.Host := RemoteHostEdit.Text;
      ClientSocket1.Port := 9999;
      ClientSocket1.Open;}
end;

procedure TForm1.SpeedButton1Click(Sender: TObject);

begin
   nmemo.Clear;
   clientsocket1.Close;
   serversocket1.Close;
   Disconnect(nil,nil);
   button1.Enabled:=true;
   InitSocket;
end;

procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
        Close;
end;

end.

//================project=========================
program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
0
 
LVL 12

Assisted Solution

by:Lee_Nover
Lee_Nover earned 150 total points
Comment Utility
you could also check out my example on VoIP
it's based on ACMCompos 1.4 and Indy 9 UDP
http://lee.nover.has.his.evilside.org/isapi/pas2html.dll/pas2html?File=/delphi/projects/VoIP
0
 
LVL 22

Expert Comment

by:mnasman
Comment Utility
Hello

  another component but it's expensive

ASTA VoIP
http://www.astatech.com/products/voip/
0
 

Author Comment

by:shaza
Comment Utility
hi friends:
if you know free componenet please tell me because i have no money .
thanks
fayiz
0
 
LVL 12

Expert Comment

by:Lee_Nover
Comment Utility
the link I gave you is free source :)
the components used are also free
all you need to do is to checkout that link
all the locations of 3rd party components are in the readme files
if you still need help let me know
0
 

Author Comment

by:shaza
Comment Utility
hi ahmed1:
i have tried to use this code but i face some error while i'm runing the application ,the errors as follow :

Error: Play format not supported
Error: Record format not supported
Error: Problem creating play handle
Error: Problem creating record handle
Error: In Prepare error
Error: Add buffer error
Error: Start error

NOTE  that this error acure just when i use aseparet computers (one for client and one for the server).
And it doesn't acure when both client and server in the same computer.
   Shaza
0
 
LVL 12

Expert Comment

by:Lee_Nover
Comment Utility
why don't you check out thelink I gave you ?
I've made that app and it works
it's also very simple, made with some free components
0
 

Author Comment

by:shaza
Comment Utility
hi lee nover:
i try to download the application but it give me error message like:
1."class TTBToolbar not found" when i try to download MainU.pas.
2."can not find resource file" when i try to download VoIP.dpr.
shaza
   
0
 
LVL 12

Expert Comment

by:Lee_Nover
Comment Utility
as I said .. all the 3rd party components are in the "3rdparty" directory, if not there then there's a link to them in the readme file
0
 

Author Comment

by:shaza
Comment Utility
hi lee nover:
is this component send voice or voice and picture?
shaza
0
 
LVL 12

Expert Comment

by:Lee_Nover
Comment Utility
acm is only for audio
for video I've done something else
I might even make it a component
here's the link to the VideoCompression/Decompression unit
http://lee.nover.has.his.evilside.org/isapi/pas2html.dll/pas2html?File=/delphi/MiscFiles/VideoCoDec.pas

to send over internet I use Indy UDP and my TlnDynBuffer for buffering the frames
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:shaza
Comment Utility
how i can install this component?
shaza
0
 
LVL 12

Expert Comment

by:Lee_Nover
Comment Utility
as you would any other ... I'm not going into installing components, that's the basics of delphi
0
 

Expert Comment

by:Ahmed1
Comment Utility
hi shaza
     this code is running well on my network,
the format errors may be because of the default recording
or playback device setting in the control panel.
0
 

Author Comment

by:shaza
Comment Utility
hi ahmed:
i will try to run it again ,but i want to ask you is this application send voice from client to server and from server to client too,or it send voice from client to server only ,and this two procedure are they belong to the same button because there is one button in this application.
procedure TForm1.ConnectButtonClick(Sender: TObject);
begin

      if ClientSocket1.Active then ClientSocket1.Active := False;
 if InputQuery('Computer to connect to', 'Address Name:', Server) then
   if Length(Server) > 0 then
     with ClientSocket1 do
     begin
        ClientSocket1.Port := 9999;
       Host := Server;
       Active := True;
       ClientSocket1.Host := RemoteHostEdit.Text;

     end;



end;
procedure TForm1.Button1Click(Sender: TObject);
begin
    if ClientSocket1.Active then ClientSocket1.Active := False;
 if InputQuery('Computer to connect to', 'Address Name:', Server) then
   if Length(Server) > 0 then
     with ClientSocket1 do
     begin
        ClientSocket1.Port := 9999;
        Host := Server;
        Active := True;

      // ClientSocket1.Host := RemoteHostEdit.Text;

       end;

   { ClientSocket1.Host := RemoteHostEdit.Text;
     ClientSocket1.Port := 9999;
     ClientSocket1.Open;}
end;

shaza.
0
 

Author Comment

by:shaza
Comment Utility
hi lee nover:
i install two component (Acmin,Acmout) ,but a face a proplem when im trying to install (Tacmconvertor) component
i can't find the component to install please help me because the application dose not work until i install this component.
shaza.
0
 
LVL 12

Expert Comment

by:Lee_Nover
Comment Utility
if you downloaded acm.zip from my link then you should have the packages in there
first compile the pkg_ACMConvertor package, then the other two in any order
should work perfectly :)

oh btw .. the packages are in D6 format, but it should work with d5 as well
0
 

Author Comment

by:shaza
Comment Utility
hi lee nover :
im compile pkg_acmconvertorpackage first but i face this problem:
[Fatal Error] ACMConvertorReg.pas(36): File not found: 'dfs.inc'
shaza
0
 

Author Comment

by:shaza
Comment Utility
i compile it correctly but there is two component was install(acmin,acmout) in (sound) package.is it correct or there is an error?
shaza
0
 

Author Comment

by:shaza
Comment Utility
we have error when we try to run the application after we install the three component . the error is:
class TTBToolbar not found.
shaza
0
 
LVL 12

Expert Comment

by:Lee_Nover
Comment Utility
my last post related to installing components !
dfs.inc is in the 3rdParty folder ! take a closer look !
TBToolbar is also there ...
0
 

Author Comment

by:shaza
Comment Utility
hi ahmed1:
is the client application in form and the server application in another form or the two application(client,server) in the same form .
And tell me each procedure in this application refer to what?
please quicklly
shaza
0
 

Expert Comment

by:Ahmed1
Comment Utility
Hi Shaza

   this program is to make voice chat, the same program must be runing in each computer (only 2), the program sends and receive voice at the same time (full dublex)

procedure TForm1.InitAudio;//to prepare sound parameters and open the Wavein, Wave out devices
procedure TForm1.CreateInBlock;// to handle the buffers creation during recording and sending
procedure TForm1.CreateOutBlock(memBlock: PmemBlock; size: Integer);// to make blocks to be sent using the socket
procedure TForm1.MMOutDone(var msg:Tmessage);// callback function called when playing sound is doneprocedure TForm1.MMInDone(var msg:Tmessage);//callback function called when recording is done
procedure TForm1.CloseAudio;// close wavein, waveout device
procedure TForm1.InitSocket;// set connection parameters
procedure TForm1.ConnectButtonClick(Sender: TObject);//
get the IP address from user and do connection
procedure TForm1.Read(Sender: TObject; Socket: TCustomWinSocket); // on data received from computer
procedure TForm1.Write(Sender: TObject;
 Socket: TCustomWinSocket);// on data sent to other computer
{procedure TForm1.Button1Click(Sender: TObject);} the same button click (one of them is linked to the button and the other can be deleted)

note
    this code is supplied to me by a friend , I did'nt event modify it.
0
 
LVL 1

Expert Comment

by:pnh73
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between Lee_Nover and Ahmed1

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now