Voice Chat Using Client/Server Architecture
Application Details
This software is based on the client/server architecture. Communication between the clients is established through the server. Initially, the server is started. Clients connect to the server host. The server sends the new client list to all the existing clients. The client can select a destination user from the user combo box. The software also provides save and play (the user can save the sound and play it later). The client also has a volume control feature. When the client application is started, a microphone select option (recording) is enabled and the microphone mute option (playing) is checked automatically by the program. (The user doesn't have to worry about the external settings.)
Technical Details
In Display Class
When the client application starts recording and playing threads created in OnInitDialog() of the Display class.
// Create and Start Recorder Thread record=new RecordSound(this); record->CreateThread(); //Create and Start Player Thread play=new PlaySound1(this); play->CreateThread();
Thread functions are based on the code by the great person Paul Cheffers (from the CodeGuru site). I am grateful to him for making my dream project become a reality.
PreCreateHeader() of the Display class (from the constructor) creates some buffers for playing wavedata. (This prevents the creation of buffers during runtime...) When the client presses the connect button OnConnect() of the Display class, it connects client to server and displays the userlist and start button. On pressing the start button. recording and playing are started by sending a message to the recording and playing thread (OnStart function).
record->PostThreadMessage(WM_RECORDSOUND_STARTRECORDING,0,0); play->PostThreadMessage(WM_PLAYSOUND_STARTPLAYING,0,0);
These messages will activate corresponding functions defined in the message map of the respective thread class.
On pressing the stop button, recording and playing are stopped by in the same way as above (OnStop Function). It also contains other functions that will be activated on pressing the buttons....and some functions are activated from other classes (mysocket and RecordSound classes).
In mysocket class
OnReceive: When data arrives at the client, it will call the Display class's receive function, which plays the sound by sending message to the PlaySound thread.
play->PostThreadMessage(WM_PLAYSOUND_PLAYBLOCK,0,(LPARAM)lpHdr);
Message Format:
Total length : 2020 bytes 15 : header (destination username or special status) 5 : Length of actual data 2000 : Reserved for actual data.
RecordSound class
The PreCreateHeader() function creates buffers for recording data. These are added using the waveInPrepareHeader() and waveInAddBuffer() functions in the OnStartRecording function. (It is called when the start button is clicked, as explained earlier.)
Playsound1 class
Contains the functions for starting, playing, and stopping wavedata. Buffers are created initially in the Display class itself.
MicMute, MicPhone, and Mixer are the special classes to add several extra features to the Voice Chat function. Some of the concepts are collected from various developers at the CodeGuru site. I am grateful to those developers!!!
Running the Application
First, start the server application (with port number xxx). Then, start a minimum of two clients on any hosts (same or different). I should mention that the server hosts address and port xxx with username xyz. Then, click the connect button. The userlist will be displayed. Select the user and click the start button to start the chat...
Note: Any client can chat with any other client; hence, a client can receive data from any number of clients. Performance depends upon the situation. Developers are free to use their own ideas. (Please let me know if you see some new mechanism.)
I am eagerly waiting for your doubts and suggestions at nsry2002@yahoo.co.in.
I am grateful to the CodeGuru site for connecting developers....and helping us realise their dreams!!!

Comments
Doubt regarding Video conferencing
Posted by gokulpalwe on 02/04/2010 07:48ameBook for Voice Chat/Communication
Posted by walim_2007 on 11/29/2006 09:49pmI respect and very thank for this demo project programming. Please let me know, Where I can get a free ebook for development this programming. Currently, I am developing project for voice switching communication. Thanks. Regards, Wali M.
-
-
Replynice
Posted by saltana on 06/29/2008 05:51amvery
Replyvery nice
Posted by kantipur on 10/31/2007 09:50amvery goog
ReplyeBook for Voice Chat/Communication
Posted by walim_2007 on 11/29/2006 09:48pmI respect and very thank for this demo project programming. Please let me know, Where I can get a free ebook for development this programming. Currently, I am developing project for voice switching communication. Thanks. Regards, Wali M.
ReplyeBook for Voice Chat/Communication
Posted by walim_2007 on 11/29/2006 09:47pmI respect and very thank for this demo project programming. Please let me know, Where I can get a free ebook for development this programming. Currently, I am developing project for voice switching communication. Thanks. Regards, Wali M.
-
ReplyChat using Client/Server Architecture
Posted by auanh on 07/25/2007 10:43pmI want use its. Thanks
ReplyeBook for Voice Chat/Communication
Posted by walim_2007 on 11/29/2006 09:43pmI respect and very thank for this demo project programming. Please let me know, Where I can get a free ebook for development this programming. Currently, I am developing project for voice switching communication. Thanks. Regards, Wali M.
ReplyCompile error?
Posted by eAs on 10/25/2004 07:20amI cannot compile the client application, I get the following error WriteSound.cpp(13): error C2440: 'static_cast' : cannot convert from 'LRESULT (__thiscall WriteSound::* )(WPARAM,LPARAM)' to 'void (__thiscall CWinThread::* )(WPARAM,LPARAM)' Any suggestions?, I'm using Microsoft Development Environment 2003 under XPSP2 Thanks
Replynoise when used over internet
Posted by eid on 10/20/2004 07:24amhi, thanks for this good program i tried it and it have some problems, the most one when i used it over the internet i hair a noise with sound and i can't now the source of it. can any one help me.
-
Replychanging the audio format settings may help..
Posted by nsry on 10/25/2004 01:17amIf you change the waveformat settings and buffer size that will help..you may need to do some trial and error check to get right settings...because voice quality depends upon bandwidth and wave format parameters...
Replybandwidth
Posted by Legacy on 01/26/2004 12:00amOriginally posted by: kukuh
Dear Mr,
Replyi want to know about the bandwidth that application use in Local Area network, or please give me clues for application that can be used for the performance test of voice chat application.
thanks b-4
Important api's
Posted by Legacy on 12/23/2003 12:00amOriginally posted by: Muthu
sir,
Thanx for answering me sir,i am happy &Another important question sir!! plzz What r the important api's used& for what purpose?? pls list out sir..it's ver y urgent.. .so kindly do me this favour....i will be very h appy sir!!!
pls send me as soon as possible....its urgent..
thanking you
yours faithfuly
Muthu
ReplySending Pictures Over The Network
Posted by Legacy on 12/15/2003 12:00amOriginally posted by: Muhammad Kashif
Dear Friend,
ReplyI have developed a peer to peer version of your project.Your efforts are just incredible.The code written was very precise and no useless files were included.
Now i am thinking about transfering pics taken by a pc camera over the network.Do you have any idea about that.Please help me in this regard as well.
Video Over InterNet Protocol VidOIP.
Loading, Please Wait ...