Leya 发表于 2008-4-27 14:37:22

Voice Compression - 语音分析

There is a high probability that your server won't be running off a T1 connection, it will probably be running out of business cable which won't have a lot of bandwidth. Without a lot of bandwidth people will lag and eventually leave, so administrators always try to optimize theirs servers as much as possible to use less bandwidth. Voice communications used a lot of bandwidth... Until today!

Valve has added the support for the Speex voice encoder. By default, HLDS is set to use the old MILES codec that uses almost 32kbps of your bandwidth compared to the Speex codec that can use from 2.4kbps 15.2kbps (depending on which one you select). Be warned that Speex will use more CPU cycles than MILES... On my 500mhz server, it uses only 2 or 4 percents more CPU!
Enabling Speex is not a difficult task. You enable it with CVARS... First, you need to enable Speex itself by using the sv_voicecodec voice_speex CVAR and then you configure which quality you want by using ONE of these CVARS.

CVARQuality (in KBPS)Percent of bandwidth used compared to MILESsv_voicequality 12.47.5%sv_voicequality 2618.75%sv_voicequality 3825%sv_voicequality 411,235%sv_voicequality 515,247.5%And for all the non-geeks out there, here is a simpler version of the table:
CVARQualitysv_voicequality 1Very badsv_voicequality 2Badsv_voicequality 3Mediumsv_voicequality 4Goodsv_voicequality 5Crystal-Clear! (Best)sv_voicequality 2 would be perhaps an excellent choice for a server who has mediocre bandwidth and want good voice quality.
Finnaly, I'm giving you a code example of what you should have in your server.cfg file if you wanted to have the Speex codec enabled at the voice quality 2
sv_voicecodec voice_speex
sv_voicequality 2
页: [1]
查看完整版本: Voice Compression - 语音分析