summaryrefslogtreecommitdiff
path: root/src/client/cl_cgame.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/cl_cgame.c')
-rw-r--r--src/client/cl_cgame.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/client/cl_cgame.c b/src/client/cl_cgame.c
index 2e28d049..6e436316 100644
--- a/src/client/cl_cgame.c
+++ b/src/client/cl_cgame.c
@@ -24,6 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// cl_cgame.c -- client system interaction with client game
#include "client.h"
+#include "libmumblelink.h"
extern qboolean loadCamera(const char *name);
extern void startCamera(int time);
@@ -955,6 +956,52 @@ void CL_FirstSnapshot( void ) {
Cbuf_AddText( cl_activeAction->string );
Cvar_Set( "activeAction", "" );
}
+
+#ifdef USE_MUMBLE
+ if ((cl_useMumble->integer) && !mumble_islinked()) {
+ int ret = mumble_link(CLIENT_WINDOW_TITLE);
+ Com_Printf("Mumble: Linking to Mumble application %s\n", ret==0?"ok":"failed");
+ }
+#endif
+
+#ifdef USE_VOIP
+ if (!clc.speexInitialized) {
+ int i;
+ speex_bits_init(&clc.speexEncoderBits);
+ speex_bits_reset(&clc.speexEncoderBits);
+
+ clc.speexEncoder = speex_encoder_init(&speex_nb_mode);
+
+ speex_encoder_ctl(clc.speexEncoder, SPEEX_GET_FRAME_SIZE,
+ &clc.speexFrameSize);
+ speex_encoder_ctl(clc.speexEncoder, SPEEX_GET_SAMPLING_RATE,
+ &clc.speexSampleRate);
+
+ clc.speexPreprocessor = speex_preprocess_state_init(clc.speexFrameSize,
+ clc.speexSampleRate);
+
+ i = 1;
+ speex_preprocess_ctl(clc.speexPreprocessor,
+ SPEEX_PREPROCESS_SET_DENOISE, &i);
+
+ i = 1;
+ speex_preprocess_ctl(clc.speexPreprocessor,
+ SPEEX_PREPROCESS_SET_AGC, &i);
+
+ for (i = 0; i < MAX_CLIENTS; i++) {
+ speex_bits_init(&clc.speexDecoderBits[i]);
+ speex_bits_reset(&clc.speexDecoderBits[i]);
+ clc.speexDecoder[i] = speex_decoder_init(&speex_nb_mode);
+ clc.voipIgnore[i] = qfalse;
+ clc.voipGain[i] = 1.0f;
+ }
+ clc.speexInitialized = qtrue;
+ clc.voipMuteAll = qfalse;
+ Cmd_AddCommand ("voip", CL_Voip_f);
+ Cvar_Set("cl_voipSendTarget", "all");
+ clc.voipTarget1 = clc.voipTarget2 = clc.voipTarget3 = 0x7FFFFFFF;
+ }
+#endif
}
/*