diff options
author | icculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2008-06-08 07:29:25 +0000 |
---|---|---|
committer | icculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2008-06-08 07:29:25 +0000 |
commit | 06b417ad1952ba223af455c13bc834690d851903 (patch) | |
tree | 34576a5a5e98fcc99a76a132a505b5dc16af7c4e /code/client | |
parent | 00eb1434b11cf43a1decf218d08d5ea8c9280a08 (diff) | |
download | ioquake3-aero-06b417ad1952ba223af455c13bc834690d851903.tar.gz ioquake3-aero-06b417ad1952ba223af455c13bc834690d851903.zip |
VoIP: tweaked VAD code.
Also added cl_voipVADThreshold cvar...if the power of a set of Speex frames
doesn't exceed this value, it isn't transmitted.
git-svn-id: svn://svn.icculus.org/quake3/trunk@1379 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/client')
-rw-r--r-- | code/client/cl_main.c | 4 | ||||
-rw-r--r-- | code/client/client.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/code/client/cl_main.c b/code/client/cl_main.c index 3fa0933..13de133 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -35,6 +35,7 @@ cvar_t *cl_mumbleScale; #if USE_VOIP cvar_t *cl_voipUseVAD; +cvar_t *cl_voipVADThreshold; cvar_t *cl_voipSend; cvar_t *cl_voipSendTarget; cvar_t *cl_voipGainDuringCapture; @@ -384,7 +385,7 @@ void CL_CaptureVoip(void) clc.voipPower = voipPower / (32768.0f * 32768.0f * ((float) (clc.speexFrameSize * speexFrames))); - if ((useVad) && (clc.voipPower > 0.25f)) { + if ((useVad) && (clc.voipPower < cl_voipVADThreshold->value)) { CL_VoipNewGeneration(); // no "talk" for at least 1/4 second. } else { clc.voipOutgoingDataSize = wpos; @@ -3082,6 +3083,7 @@ void CL_Init( void ) { cl_voipSendTarget = Cvar_Get ("cl_voipSendTarget", "all", 0); cl_voipGainDuringCapture = Cvar_Get ("cl_voipGainDuringCapture", "0.2", CVAR_ARCHIVE); cl_voipUseVAD = Cvar_Get ("cl_voipUseVAD", "0", CVAR_ARCHIVE); + cl_voipVADThreshold = Cvar_Get ("cl_voipVADThreshold", "0.0025", CVAR_ARCHIVE); voip = Cvar_Get ("voip", "1", CVAR_USERINFO | CVAR_ARCHIVE | CVAR_LATCH); // This is a protocol version number. diff --git a/code/client/client.h b/code/client/client.h index 1514582..329d67a 100644 --- a/code/client/client.h +++ b/code/client/client.h @@ -412,6 +412,7 @@ extern cvar_t *cl_mumbleScale; // send to no one, or a comma-separated list of client numbers: // "0,7,2,23" ... an empty string is treated like "all". extern cvar_t *cl_voipUseVAD; +extern cvar_t *cl_voipVADThreshold; extern cvar_t *cl_voipSend; extern cvar_t *cl_voipSendTarget; extern cvar_t *cl_voipGainDuringCapture; |