Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xiph/speex.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>2008-04-11 07:49:08 +0400
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>2008-04-11 07:49:08 +0400
commitfbb903751e0d94da1f9ddc081485be53eda7ec3f (patch)
tree0d6ab7d3fbc52aae67f444d4d36d82371a2af348
parentb80fc6416ff082bb08e5928bd0cbe7c9a1c6f708 (diff)
SPEEX_PREPROCESS_SET_AGC_LEVEL is now back to its original semantic as thisSpeex-1.2beta3.2
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
-rw-r--r--configure.ac4
-rw-r--r--include/speex/speex_preprocess.h9
-rw-r--r--libspeex/preprocess.c16
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;