mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
fix opus
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user