Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8275335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:02:58+00:00 2026-06-08T08:02:58+00:00

I’m looking to develop a WCF voice chat application. I would like to use

  • 0

I’m looking to develop a WCF voice chat application.

I would like to use WCF service to build the application

|             Invite                | 

| --------------------------------> |

|               OK                  |

| <-------------------------------- |

|                                   |

| --------------------------------> |

|            Audio flow             |

| <-------------------------------- |

|               Bye                 | 

| --------------------------------> |

A                                   B

in other way the same application should have the listening service, so it receives calls and sends calls to the other same application on the other machine. (Without the need for an extra service host application to receives calls).

I know maybe i should use a specific protocols like sockets or other for transferring voice, but i will check about that later.

So what kind of WCF service should i use, and what type of binding would be the best for this purpose.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:03:00+00:00Added an answer on June 8, 2026 at 8:03 am

    As the comment on your question says, UDP or other streaming protocols are usually preferred. But with WCF providing more abstraction, would be easier to do something like this. Having said that I have implemented a voice chatting feature on one of our previous software (the software was used by multiple clients in a LAN) with WCF and netTcpBinding, and it worked well (I tested it with 5 clients in a LAN), you couldn’t really feel that WCF hindered the architecture. It will get interesting with the release of WCF 4.5 which will be supporting UDP transport.

    For something like this, you should really get the gist of duplex communication in WCF. I went about with doing in such a way that i had a SendVoice() operation contract on my service, everytime a client sent their asudio stream to the service, the SendVoice() method would iterate through the list of subscribers (connected clients) and invoke the SendVoiceCallback() on each client. You could start with something like this:

    public void SendVoice(byte[] audio)
    {
        //Keep a list of connected clients in a dictionary called subscribers
        //lock your subscribers list so that it's not modified when you're in the middle of sending the stream              
            lock (subscribers)
            {
            //send the received voice stream to each client
                foreach (var _subscriber in subscribers)
                {
                    if (OperationContext.Current.GetCallbackChannel<IVoiceChatCallback>() == subscriber.Key)
                    {
                //if the person who sent the video is the current subscriber then don't send the video to THAT subscriber
                                continue;
                    }
                    try
                    {
                     //Send the received stream to the client asynchronously
                                _subscriber.Key.BeginOnVoiceSendCallback(audio, onNotifyCompletedVoiceSend, _subscriber.Key);
                     }
                     catch (Exception)
                     {
                                //fault handling
                     }
                }
            }
    }
    

    Your clients would then call the method above periodically, in my implementation I set this to every 250 milliseconds and it worked perfectly well (obviously there was a small lag).

    In the code above IVoiceChatCallback is the callback contract. Callbacks enable the service to invoke some operation on the clients, so for an isntance the client will behave like a server.
    Asynchronous service calls will mean that your SendVoice() will publish the audio to every client asynchronously, rather than waiting for the previous stream to reach the client before sending the new stream.

    The code above is just an idea for you to get started. You should add some fault handling code to the service to check when clients are disconnected and remove them from your subscribers dictionary. Again You should become comfortable with asynchronous operation calls in WCF as well as callbacks. Also if you’re looking to use this in LAN, then netTcpBinding is the way to go, and you should configure your service as to optimise its throughput and concurrency. Over the internet, you’d want to use a Http Binding that supports duplex.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.