|
|
@ -428,6 +428,9 @@ void Voice_Disconnect( void ) |
|
|
|
voice.players_status[i].talking_ack = false; |
|
|
|
voice.players_status[i].talking_ack = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VoiceCapture_Shutdown(); |
|
|
|
|
|
|
|
voice.device_opened = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
@ -588,23 +591,22 @@ Voice_Init |
|
|
|
Initialize the voice subsystem |
|
|
|
Initialize the voice subsystem |
|
|
|
========================= |
|
|
|
========================= |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
qboolean Voice_Init( const char *pszCodecName, int quality ) |
|
|
|
qboolean Voice_Init( const char *pszCodecName, int quality, qboolean preinit ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( !voice_enable.value ) |
|
|
|
if( !voice_enable.value ) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// reinitialize only if codec parameters are different
|
|
|
|
|
|
|
|
if( Q_strcmp( pszCodecName, voice.codec ) || voice.quality != quality ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Voice_Shutdown(); |
|
|
|
|
|
|
|
|
|
|
|
if( Q_strcmp( pszCodecName, VOICE_OPUS_CUSTOM_CODEC )) |
|
|
|
if( Q_strcmp( pszCodecName, VOICE_OPUS_CUSTOM_CODEC )) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Con_Printf( S_ERROR "Server requested unsupported codec: %s\n", pszCodecName ); |
|
|
|
Con_Printf( S_ERROR "Server requested unsupported codec: %s\n", pszCodecName ); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// reinitialize only if codec parameters are different
|
|
|
|
|
|
|
|
if( !Q_strcmp( voice.codec, pszCodecName ) && voice.quality == quality ) |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Voice_Shutdown(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
voice.autogain.block_size = 128; |
|
|
|
voice.autogain.block_size = 128; |
|
|
|
|
|
|
|
|
|
|
|
if( !Voice_InitOpusDecoder( )) |
|
|
|
if( !Voice_InitOpusDecoder( )) |
|
|
@ -627,9 +629,15 @@ qboolean Voice_Init( const char *pszCodecName, int quality ) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
voice.quality = quality; |
|
|
|
voice.quality = quality; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if( !VoiceCapture_Init( )) |
|
|
|
if( !preinit ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
voice.device_opened = VoiceCapture_Init(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( !voice.device_opened ) |
|
|
|
Con_Printf( S_WARN "No microphone is available.\n" ); |
|
|
|
Con_Printf( S_WARN "No microphone is available.\n" ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|