This commit is contained in:
HappyDOGE 2022-07-28 18:32:42 +03:00
parent 0aa1fe0b8d
commit de84690884
4 changed files with 11 additions and 2 deletions

View File

@ -671,7 +671,7 @@ bool Voice_Init( const char *pCodecName, int nSampleRate )
//
// Changing the quality level we use here will require either extending SVC_VoiceInit to pass down which quality is
// in use or using a different codec name (vaudio_celtHD!) for backwards compatibility
int quality = bCelt ? 3 : 4;
int quality = ( bCelt || bOpus ) ? 3 : 4;
// Get the codec.
CreateInterfaceFn createCodecFn = NULL;

View File

@ -97,6 +97,11 @@ bool VoiceEncoder_Opus::Init( int quality, int &rawFrameSize, int &encodedFrameS
m_Mode = opus_custom_mode_create( g_OpusOpts[m_iVersion].iSampleRate, g_OpusOpts[m_iVersion].iRawFrameSize, &iError );
if ( iError != 0 ) {
Msg( "Opus init failed with error %d", iError );
return false;
}
m_EncoderState = opus_custom_encoder_create( m_Mode, CHANNELS, NULL);
m_DecoderState = opus_custom_decoder_create( m_Mode, CHANNELS, NULL);

2
lib

@ -1 +1 @@
Subproject commit 7ec9e1386e7c14539ce09cf27bf8903368afaaed
Subproject commit b3fe8769dbcb1b6cf991b2612c23f55b68c7ac4e

View File

@ -138,6 +138,7 @@ def define_platform(conf):
conf.env.DEDICATED = conf.options.DEDICATED
conf.env.TOGLES = conf.options.TOGLES
conf.env.GL = conf.options.GL
conf.env.OPUS = conf.options.OPUS
if conf.options.DEDICATED:
conf.options.SDL = False
@ -507,6 +508,9 @@ def build(bld):
projects['game'] += ['utils/bzip2']
projects['dedicated'] += ['utils/bzip2']
if bld.env.OPUS or bld.env.DEST_OS == 'android':
projects['game'] += ['engine/voice_codecs/opus']
if bld.env.DEDICATED:
bld.add_subproject(projects['dedicated'])
else: