Click here to Skip to main content
Click here to Skip to main content
Go to top

Voice and Text Conferencing Library

, 14 Feb 2010
Rate this:
Please Sign up or sign in to vote.
A library for creating a voice and text conferencing application
ConferenceServer

ConferenceClient

Introduction

This Library was a part of my final year project. I have searched a lot on the web related to voice conferencing in C# but I couldn't find anything useful so I decided to modify peer to peer voice chat code that I found on CodeProject named “A Voice Chat Application in C#” into Voice conferencing. It also contains Text Conferencing feature that helps programmers to build conferencing software.

Voice Conferencing is based on client server architecture. Voice Conferencing Server uses two servers one for managing client (e.g. adding and removing client) and the other to handle communication. Voice Conferencing Client also uses two clients, one for entry and exit and the other for communication. Text Conferencing also uses client/server architecture. Text Conferencing server utilizes one TCP Server and Text Conferencing Client is based on a TCP client.

The main feature of this Conferencing Library is that it provides the complete implementation of conferencing work. Programmers just have to use its predefined methods and events in their code.

Using the Code

Voice Conferencing

VoiceConferencingServer class handles all work related to Voice Chat at the server side. Its constructor takes three arguments:

public VoiceConferencingServer(String Name,int HandlingPort,int CommunicationPort)
  1. Server Name (String)
  2. Handling Port (this port is used for handling Clients entry and exit in Voice Chat Server)
  3. Communication Port (all the voice communication is done through this port)

VoiceConferencingServer class contains two events related to User Handling and four methods related to voice conferencing.

interface VoiceConferencingServer {                  
       //User Handling Events             
       event VoiceChatServer.UserAddedEventHandler ClientAdded;                 
       event VoiceChatServer.UserRemovedEventHandler ClientRemoved;
       //Methods    
       void InitializeCall(object sender);   
       void UninitializeCall(); void Mute(); 
       void Unmute(); 
       }

ClientAdded Event is raised when a new Client is logged into the voice server. It uses UserArgs class as argument.

ClientRemoved Event is raised when a new Client is logged out to the voice server. It uses UserArgs class as argument.

InitializeCall Method takes one argument “Form control”. This method starts both the user handling and voice communication server.

UninitializeCall Method disposes servers and terminates all communication between client and server.

Mute Method is used to mute server voice.

Unmute Method is used to unmute server voice.

VoiceConferencingClient class handles all work related to Voice conferencing on client side. Its constructor takes four arguments:

public VoiceConferencingClient
	(String _ServerIP,String Name,int HandlingPort,int CommuncationPort)
  1. _ServerIP (Server IP Address)
  2. Name (Client Name)
  3. Handling Port (this port is used for handling logged in and logged out process in VoiceConferencingClient)
  4. Communication Port (All the voice communication is done through this port)

VoiceConferencingClient class contains four methods related to voice conferencing.

interface VoiceConferencingClient { 
          void InitializeCall(object sender);     
          void UninitializeCall(); 
          void Mute(); 
          void Unmute(); 
          }

InitializeCall Method connects to server and starts voice conferencing between client and server.

UninitializeCall Method disposes clients and terminates all communication between client and server.

Mute Method is used to mute client voice.

Unmute Method is used to unmute client voice.

Text Conferencing

TextConferencingServer class handles all work related to Text conferencing on server side. Its constructor takes two arguments:

public TextConferencingServer(int Port,String Name)
  1. Port (it is used to handle conferencing work)
  2. Name (Server Name)

TextConferencingServer class contains three events and two methods:

interface ITextConferencingServer{  
       //Events                  
       event TextConferencingServer.ClientAddedEventHandler ClientAdded;           
       event TextConferencingServer.ClientRemovedEventHandler ClientRemoved;
       event TextConferencingServer.MessageEventHandler MessageRecieved;
       //Methods      
       void SendMessage(string mess, string reciever);
       void BroadcastMessage(byte[] message);
       }

ClientAdded Event is raised when a new Client is logged into the voice server. It uses UserArgs class as argument.

ClientRemoved Event is raised when a new Client is logged out to the voice server. It uses UserArgs class as argument.

MessageRecieved Event is raised when message is received on server. It uses MessageArgs class as argument.

SendMessage Method takes two arguments, one message that you want to send and second client name to whom you want to send.

BroadcastMessage Method takes one argument message that you want to broadcast to all connected users.

TextConferencingClient class handles all works related to Text conferencing on client side. Its constructor takes two arguments:

public TextConferencingClient(String ServIP,int Port, String Name)
  1. ServIP (Server IP Address)
  2. Port (it is used to handle conferencing work)
  3. Name (Client Name, it should be unique)

TextConferencingClient class contains three events and one method.

interface ITextConferencingClient{ 
          //Events 
          event TextConferencingClient.MessageEventHandler MessageRecieved; 
          event TextConferencingClient.UserAddedEventHandler UserAdded;
          event TextConferencingClient.UserRemovedEventHandler UserRemoved;
          //Methods
          void sendMessage(string message, string Reciever);
          }

ClientAdded Event is raised when a new Client is logged in to the voice server. It uses UserArgs class as argument.

ClientRemoved Event is raised when a new Client is logged out to the voice server. It uses UserArgs class as argument.

MessageRecieved Event is raised when message is received on server. It uses MessageArgs class as argument.

SendMessage Method takes two arguments, one message that you want to send and second client name to whom you want to send.

Prerequisite

You need to have DirectX installed in your PC, because this library use DirectX to capture sound and you also have to add DirectX’s DLL in your project. You can download it from Microsoft’s website.

References

  1. Voice Chat Application in C#
  2. Chat Application Using Asynchronous UDP sockets

Future Work

I am working on webcam conferencing and Remote Desktop and I hope it will be on CodeProject very soon.

History

  • 15th February, 2010: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Irfan alam
Software Developer Technology Promotion International
Singapore Singapore
He is a Software Engineer working in Technology Promotion International.He has completed his BS(Software Engineering) from University of Karachi,Pakistan.he has scored 1st Position in the batch of 2008 in department of Computer Science and scored 2nd Position in faculty of Science.
He has been working in Technology Promotion International since June 2008. Here,he has worked on many Projects and learned many different technologies like WPF, Silverlight, LINQ and many more.His major expertise are in C#,ASP.NET,Crystal Report,SQL Server.

Comments and Discussions

 
Questionvideo and audio conference using vb.net PinmemberMember 997221820-Apr-13 6:45 
Questionvoicecall PinmemberGrishma Doshi21-Feb-12 22:10 
i hv downloaded this application& can not connect again for voicecall
Questionhow to run Pinmemberpankajm324-Feb-11 19:03 
GeneralConferencelibrary Pinmemberpankajm323-Feb-11 23:21 
Questionarabic support Pinmemberleonkennedy5-Feb-11 8:34 
GeneralHi Pinmemberandersonguilherm19-Jul-10 22:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140921.1 | Last Updated 15 Feb 2010
Article Copyright 2010 by Irfan alam
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid