Commit fbb90375 authored by jm's avatar jm

SPEEX_PREPROCESS_SET_AGC_LEVEL is now back to its original semantic as this

would have caused too much problems. The int version is now called
SPEEX_PREPROCESS_SET_AGC_TARGET.


git-svn-id: http://svn.xiph.org/trunk/speex@14702 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent b80fc641
......@@ -7,10 +7,10 @@ AM_CONFIG_HEADER([config.h])
SPEEX_MAJOR_VERSION=1
SPEEX_MINOR_VERSION=1
SPEEX_MICRO_VERSION=15
SPEEX_EXTRA_VERSION=
SPEEX_EXTRA_VERSION=.2
#SPEEX_VERSION=
#SPEEX_VERSION=$SPEEX_MAJOR_VERSION.$SPEEX_MINOR_VERSION.$SPEEX_MICRO_VERSION$SPEEX_EXTRA_VERSION
SPEEX_VERSION="1.2beta3"
SPEEX_VERSION="1.2beta3.2"
SPEEX_LT_CURRENT=5
SPEEX_LT_REVISION=0
......
......@@ -110,9 +110,9 @@ int speex_preprocess_ctl(SpeexPreprocessState *st, int request, void *ptr);
/** Get preprocessor Voice Activity Detection state */
#define SPEEX_PREPROCESS_GET_VAD 5
/** Set preprocessor Automatic Gain Control level */
/** Set preprocessor Automatic Gain Control level (float) */
#define SPEEX_PREPROCESS_SET_AGC_LEVEL 6
/** Get preprocessor Automatic Gain Control level */
/** Get preprocessor Automatic Gain Control level (float) */
#define SPEEX_PREPROCESS_GET_AGC_LEVEL 7
/** Set preprocessor dereverb state */
......@@ -206,6 +206,11 @@ int speex_preprocess_ctl(SpeexPreprocessState *st, int request, void *ptr);
/** Get speech probability in last frame (int32). */
#define SPEEX_PREPROCESS_GET_PROB 45
/** Set preprocessor Automatic Gain Control level (int32) */
#define SPEEX_PREPROCESS_SET_AGC_TARGET 46
/** Get preprocessor Automatic Gain Control level (int32) */
#define SPEEX_PREPROCESS_GET_AGC_TARGET 47
#ifdef __cplusplus
}
#endif
......
......@@ -1067,14 +1067,14 @@ int speex_preprocess_ctl(SpeexPreprocessState *state, int request, void *ptr)
break;
#ifndef DISABLE_FLOAT_API
case SPEEX_PREPROCESS_SET_AGC_LEVEL:
st->agc_level = (*(spx_int32_t*)ptr);
st->agc_level = (*(float*)ptr);
if (st->agc_level<1)
st->agc_level=1;
if (st->agc_level>32768)
st->agc_level=32768;
break;
case SPEEX_PREPROCESS_GET_AGC_LEVEL:
(*(spx_int32_t*)ptr) = st->agc_level;
(*(float*)ptr) = st->agc_level;
break;
#endif /* #ifndef DISABLE_FLOAT_API */
case SPEEX_PREPROCESS_SET_AGC_INCREMENT:
......@@ -1194,6 +1194,18 @@ int speex_preprocess_ctl(SpeexPreprocessState *state, int request, void *ptr)
case SPEEX_PREPROCESS_GET_PROB:
(*(spx_int32_t*)ptr) = MULT16_16_Q15(st->speech_prob, 100);
break;
#ifndef DISABLE_FLOAT_API
case SPEEX_PREPROCESS_SET_AGC_TARGET:
st->agc_level = (*(spx_int32_t*)ptr);
if (st->agc_level<1)
st->agc_level=1;
if (st->agc_level>32768)
st->agc_level=32768;
break;
case SPEEX_PREPROCESS_GET_AGC_TARGET:
(*(spx_int32_t*)ptr) = st->agc_level;
break;
#endif /* #ifndef DISABLE_FLOAT_API */
default:
speex_warning_int("Unknown speex_preprocess_ctl request: ", request);
return -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment