r1403 - in trunk: . code/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jul 5 00:38:17 EDT 2008


Author: icculus
Date: 2008-07-05 00:38:16 -0400 (Sat, 05 Jul 2008)
New Revision: 1403

Modified:
   trunk/code/client/cl_main.c
   trunk/code/client/client.h
   trunk/voip-readme.txt
Log:
VOIP: Added cvar cl_voipCaptureMult to boost gain on recorded bits.


Modified: trunk/code/client/cl_main.c
===================================================================
--- trunk/code/client/cl_main.c	2008-06-30 03:38:19 UTC (rev 1402)
+++ trunk/code/client/cl_main.c	2008-07-05 04:38:16 UTC (rev 1403)
@@ -39,6 +39,7 @@
 cvar_t	*cl_voipSend;
 cvar_t	*cl_voipSendTarget;
 cvar_t	*cl_voipGainDuringCapture;
+cvar_t	*cl_voipCaptureMult;
 cvar_t	*cl_voipShowMeter;
 cvar_t	*voip;
 #endif
@@ -268,6 +269,7 @@
 static
 void CL_CaptureVoip(void)
 {
+	const float audioMult = cl_voipCaptureMult->value;
 	const qboolean useVad = (cl_voipUseVAD->integer != 0);
 	qboolean initialFrame = qfalse;
 	qboolean finalFrame = qfalse;
@@ -304,6 +306,8 @@
 			dontCapture = qtrue;  // playing back a demo.
 		else if ( voip->integer == 0 )
 			dontCapture = qtrue;  // client has VoIP support disabled.
+		else if ( audioMult == 0.0f )
+			dontCapture = qtrue;  // basically silenced incoming audio.
 
 		cl_voipSend->modified = qfalse;
 
@@ -362,8 +366,10 @@
 
 				// check the "power" of this packet...
 				for (i = 0; i < clc.speexFrameSize; i++) {
-					const float s = fabs((float) sampptr[i]);
+					const float flsamp = (float) sampptr[i];
+					const float s = fabs(flsamp);
 					voipPower += s * s;
+					sampptr[i] = (int16_t) ((flsamp) * audioMult);
 				}
 
 				// encode raw audio samples into Speex data...
@@ -3089,6 +3095,7 @@
 	cl_voipSend = Cvar_Get ("cl_voipSend", "0", 0);
 	cl_voipSendTarget = Cvar_Get ("cl_voipSendTarget", "all", 0);
 	cl_voipGainDuringCapture = Cvar_Get ("cl_voipGainDuringCapture", "0.2", CVAR_ARCHIVE);
+	cl_voipCaptureMult = Cvar_Get ("cl_voipCaptureMult", "2.0", CVAR_ARCHIVE);
 	cl_voipUseVAD = Cvar_Get ("cl_voipUseVAD", "0", CVAR_ARCHIVE);
 	cl_voipVADThreshold = Cvar_Get ("cl_voipVADThreshold", "0.25", CVAR_ARCHIVE);
 	cl_voipShowMeter = Cvar_Get ("cl_voipShowMeter", "1", CVAR_ARCHIVE);

Modified: trunk/code/client/client.h
===================================================================
--- trunk/code/client/client.h	2008-06-30 03:38:19 UTC (rev 1402)
+++ trunk/code/client/client.h	2008-07-05 04:38:16 UTC (rev 1403)
@@ -416,6 +416,7 @@
 extern	cvar_t	*cl_voipSend;
 extern	cvar_t	*cl_voipSendTarget;
 extern	cvar_t	*cl_voipGainDuringCapture;
+extern	cvar_t	*cl_voipCaptureMult;
 extern	cvar_t	*cl_voipShowMeter;
 extern	cvar_t	*voip;
 #endif

Modified: trunk/voip-readme.txt
===================================================================
--- trunk/voip-readme.txt	2008-06-30 03:38:19 UTC (rev 1402)
+++ trunk/voip-readme.txt	2008-07-05 04:38:16 UTC (rev 1403)
@@ -94,8 +94,14 @@
                   game can "hear" you. Set to "0" to disable the display of
                   the meter.
 
+cl_voipCaptureMult: Multiply recorded audio by this value after denoising.
+                    Defaults to 2.0 to _double_ the volume of your voice.
+                    This is to make you more audible if denoising eats away
+                    too much data. Set this to 1.0 to get no change, less to
+                    be quieter.
 
 
+
 Console commands:
 
 voip ignore <clientnum>




More information about the quake3-commits mailing list