diff options
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | include/speex/speex_preprocess.h | 9 | ||||
-rw-r--r-- | libspeex/preprocess.c | 16 |
3 files changed, 23 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 53205a2..5ba78d2 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/include/speex/speex_preprocess.h b/include/speex/speex_preprocess.h index bcef7be..f8eef2c 100644 --- a/include/speex/speex_preprocess.h +++ b/include/speex/speex_preprocess.h @@ -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 diff --git a/libspeex/preprocess.c b/libspeex/preprocess.c index 49ba0d0..b5575fe 100644 --- a/libspeex/preprocess.c +++ b/libspeex/preprocess.c @@ -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; |