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
+1 -1
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;
@@ -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);