r1379 - trunk/code/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Jun 8 03:29:27 EDT 2008


Author: icculus
Date: 2008-06-08 03:29:25 -0400 (Sun, 08 Jun 2008)
New Revision: 1379

Modified:
   trunk/code/client/cl_main.c
   trunk/code/client/client.h
Log:
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.


Modified: trunk/code/client/cl_main.c
===================================================================
--- trunk/code/client/cl_main.c	2008-06-08 07:09:45 UTC (rev 1378)
+++ trunk/code/client/cl_main.c	2008-06-08 07:29:25 UTC (rev 1379)
@@ -35,6 +35,7 @@
 
 #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 @@
 			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 @@
 	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.

Modified: trunk/code/client/client.h
===================================================================
--- trunk/code/client/client.h	2008-06-08 07:09:45 UTC (rev 1378)
+++ trunk/code/client/client.h	2008-06-08 07:29:25 UTC (rev 1379)
@@ -412,6 +412,7 @@
 //  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;




More information about the quake3-commits mailing list