SPEEX_PREPROCESS_SET_AGC_LEVEL is now back to its original semantic as this Speex-1.2beta3.2
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Fri, 11 Apr 2008 03:49:08 +0000 (03:49 +0000)
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Fri, 11 Apr 2008 03:49:08 +0000 (03:49 +0000)
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

configure.ac
include/speex/speex_preprocess.h
libspeex/preprocess.c

index 53205a2..5ba78d2 100644 (file)
@@ -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
index bcef7be..f8eef2c 100644 (file)
@@ -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
index 49ba0d0..b5575fe 100644 (file)
@@ -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;