SPEEX_PREPROCESS_GET_AGC_LOUDNESS patch by Mihai Balea
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Tue, 30 Oct 2007 08:57:58 +0000 (08:57 +0000)
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Tue, 30 Oct 2007 08:57:58 +0000 (08:57 +0000)
git-svn-id: http://svn.xiph.org/trunk/speex@14064 0101bb08-14d6-0310-b084-bc0e0c8e3800

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

index 59b0aab..a0d3aa3 100644 (file)
@@ -178,6 +178,10 @@ int speex_preprocess_ctl(SpeexPreprocessState *st, int request, void *ptr);
 /** Get maximal gain in dB (int32) */
 #define SPEEX_PREPROCESS_GET_AGC_MAX_GAIN 31
 
+/*  Can't set loudness */
+/** Get loudness */
+#define SPEEX_PREPROCESS_GET_AGC_LOUDNESS 33
+
 #ifdef __cplusplus
 }
 #endif
index 01b1a9b..4524002 100644 (file)
@@ -1166,6 +1166,9 @@ int speex_preprocess_ctl(SpeexPreprocessState *state, int request, void *ptr)
    case SPEEX_PREPROCESS_GET_ECHO_STATE:
       ptr = (void*)st->echo_state;
       break;
+   case SPEEX_PREPROCESS_GET_AGC_LOUDNESS:
+      (*(spx_int32_t*)ptr) = pow(st->loudness, 1.0/LOUDNESS_EXP);
+      break;
 
    default:
       speex_warning_int("Unknown speex_preprocess_ctl request: ", request);