Home » Source Code » Real-time voice communication control

Real-time voice communication control

wangshuwch
2014-06-11 03:35:20
The author
View(s):
Download(s): 4
Point (s): 2 
Category Category:
AudioAudio CPlusPlus, C-C++C++

Description

语音通信控件,集成G729A压缩算法,实时传输协议,支持一对一,一对多,多对多的实时通话,话音清晰,流畅!使用简单方便!
1) 利用多线程机制,实现录音、网络传输、放音同时进行。
2) 网络壅塞处理,保证数据不丢失。
(一)首先定义了一个声音数据“块”
1)正常网速下:nAudioIn 在 nSend 之前, nReceive 在 nAuioOu t之前,周而复始的走下去。
2)超快网速下:发送端:-->nSend追上nAudioIn-->“空转”(绕了一圈又回来了)--〉
接收端:因为录、放音的采样频率设置为相等,故不可能出现 nReceive 在n AudioOut 之后,
即收到的声音文件太多,来不及播放的现象。
3)超慢网速下:(极端情况,网速几乎为0也没关系)
发送端:nAudioIn 绕一圈反追上 nSend,于是将数据接在当前块的尾部,以待发送

接收端:nAudioOut 追上 nReceive 后,发现没有数据可播放了,就“空转”。

套接字发送、接收线程
其实,经过刚才的讨论,现在这两个线程的运作很简单---只是循环地操作nReceive和nSend指针。首先发送(接收)声音块的长度,然后发送(接收)声音内容。注意:拿CSocket::Send(buffer,count)为例,其返回值(发送出去的字结数)只是1到count之间的某值,所以要添加检测机制,否则将出现错误,这也是socket编程必须注意的。本文是用一个循环,直到发送出去的字节总数等于“块”的长度才发送第二个数据块的信息。
例外这两个线程稍加改动即可实现多人的语音会议。

Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
getdxver.exe24.00 kB22-04-04 16:01
MySock.cpp669.00 B22-04-04 16:01
MySock.h1.15 kB22-04-04 16:01
myvoip.aps20.57 kB22-04-04 16:01
myvoip.clw1.04 kB22-04-04 16:01
myvoip.cpp1.90 kB22-04-04 16:01
myvoip.def220.00 B22-04-04 16:01
myvoip.dsp9.11 kB22-04-04 16:01
myvoip.dsw535.00 B22-04-04 16:01
myvoip.h952.00 B22-04-04 16:01
myvoip.ico1.05 kB22-04-04 16:01
myvoip.ncb11.37 MB12-06-08 14:54
myvoip.odl1.91 kB22-04-04 16:01
myvoip.opt69.00 kB22-04-04 16:01
myvoip.plg3.49 kB22-04-04 16:01
myvoip.rc4.09 kB22-04-04 16:01
myvoip.sln1.32 kB12-06-08 14:54
myvoip.suo16.50 kB12-06-08 14:54
myvoip.vcproj20.24 kB12-06-08 14:54
myvoip.vcproj.GNET-CED62AFB9B.user.user2.56 kB12-06-08 14:54
MyvoipCtl.bmp238.00 B22-04-04 16:01
MyvoipCtl.cpp35.04 kB22-04-04 16:01
MyvoipCtl.h3.33 kB22-04-04 16:01
MyvoipPpg.cpp2.32 kB22-04-04 16:01
MyvoipPpg.h1.38 kB22-04-04 16:01
Resource.h541.00 B22-04-04 16:01
Sound.cpp10.76 kB22-04-04 16:01
Sound.h1.34 kB22-04-04 16:01
SoundManager.cpp14.70 kB22-04-04 16:01
SoundManager.h1.60 kB22-04-04 16:01
StdAfx.cpp204.00 B22-04-04 16:01
StdAfx.h1.18 kB22-04-04 16:01
StreamingSound.cpp7.63 kB22-04-04 16:01
StreamingSound.h961.00 B22-04-04 16:01
WaveFile.cpp18.91 kB22-04-04 16:01
WaveFile.h1.66 kB22-04-04 16:01
使用说明.CHM48.94 kB30-11-04 03:27
<Debug>0.00 B12-06-08 14:54
<www.cnzz.cn>0.00 B12-06-08 14:54
<实时语音通信的控件>0.00 B13-06-08 11:15
...
Sponsored links

Comments

(Add your comment, get 0.1 Point)
Minimum:15 words, Maximum:160 words
  • 1
  • Page 1
  • Total 1

Real-time voice communication control (3.17 MB)

Need 2 Point(s)
Your Point (s)

Your Point isn't enough.

Get 22 Point immediately by PayPal

Point will be added to your account automatically after the transaction.

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more Points

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D