Skip to content

Commit

Permalink
Fix speex compilation issue with last vcpkg pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
arves100 committed Jun 4, 2024
1 parent b81d4f8 commit 18b9150
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Voice2/gvSpeex.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,22 @@ GVBool gviSpeexInitialize(int quality, GVRate sampleRate)
int rate;
int bitsPerFrame;
int samplesPerSecond;

const SpeexMode* speexMode;

// we shouldn't already be initialized
if(gviSpeexInitialized)
return GVFalse;

// create a new encoder state
if (sampleRate == GVRate_8KHz)
gviSpeexEncoderState = speex_encoder_init(&speex_nb_mode);
speexMode = speex_lib_get_mode(SPEEX_MODEID_NB);
else if (sampleRate == GVRate_16KHz)
gviSpeexEncoderState = speex_encoder_init(&speex_wb_mode);
speexMode = speex_lib_get_mode(SPEEX_MODEID_WB);
else
return GVFalse;

gviSpeexEncoderState = speex_encoder_init(speexMode);

if(!gviSpeexEncoderState)
return GVFalse;

Expand Down Expand Up @@ -107,15 +110,19 @@ GVBool gviSpeexNewDecoder(GVDecoderData * data)
{
void * decoder;
int perceptualEnhancement = 1;
const SpeexMode* speexMode;

// create a new decoder state

if (gviGetSampleRate() == GVRate_8KHz)
decoder = speex_decoder_init(&speex_nb_mode);
speexMode = speex_lib_get_mode(SPEEX_MODEID_NB);
else if (gviGetSampleRate() == GVRate_16KHz)
decoder = speex_decoder_init(&speex_wb_mode);
speexMode = speex_lib_get_mode(SPEEX_MODEID_WB);
else
return GVFalse;

decoder = speex_decoder_init(speexMode);

if(!decoder)
return GVFalse;

Expand Down

0 comments on commit 18b9150

Please sign in to comment.