VCX. Peer-to-peer voice chat |
||
Describes how to write an audio chat application for peer-to-peer voice communication using Visual Studio (C#, Visual Basic .NET, Visual Basic 6.0 or Visual C++ 6.0). Binary : sample_chat.zip C#: sample_chat_source_csharp.zip VB.NET: sample_chat_source_vbnet.zip VB: sample_chat_source_vb.zip C++: sample_chat_source_vc.zip SetupSelect a sound card, specify a network protocol and port. Press the Quality button to select a codec and specify the other quality parameters: sampling rate, mono/stereo. We recommend using the GSM or ADPCM codec (mono) for voice communication. Use the Ready for chat checkbox to accept any incoming connection. Enter a remote IP address and press the Connect button to initiate a converstation with a remote side. Send text messagesEnter a text message and press Enter to send your text message to the remote side. Save your conversation to a WAV fileEnter a file name to the corresponding text box and check the Save to file option to save your conversation to the WAV file. Silence detectionIn order to decrease your network bandwidth usage you can use the silence detection approach, which is based on the dynamic speech processing methods. This means that only the bytes contaning the useful signal (your voice) are sent to the network. Programming backgroundA single MediaGate component is used to accomplish all the tasks: 1) Accept incoming connections: MediaGate.Active = True. 2) Initiate a connection with a remote side: the MediaGate.Connect method. 3) Send/receive text: the MediaGate.SendText method and MediaGate.OnReceiveText event. 4) Save conversation to a WAV file: MediaGate.ConversationFileName, MediaGate.ConversationSaveToFile = True.
5) Turn on the silence detection: Technical detailsMediaGate component incapsulates the following component chain: WaveIn > Codec > IpServer / IpClient > Decodec > WaveOut WaveIn records audio stream from your sound card, Codec encodes it, IpServer/IpClient receives/sends it via network, Decodec decodes it, WaveOut plays back audio stream on your sound card. |