diff options
author | jm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800> | 2008-02-13 13:11:24 +0300 |
---|---|---|
committer | jm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800> | 2008-02-13 13:11:24 +0300 |
commit | 6c143595209e25260248ad5e1d85e2d66e1509e0 (patch) | |
tree | 7ddb171f76fa14d1b45a4451b8f5c8c8de9ada68 | |
parent | 2c4578de2034388b159c6d3d1e12e7662bfb72c4 (diff) |
Thorvald Natvig: Patch to implement SPEEX_PREPROCESS_GET_AGC_GAIN
git-svn-id: http://svn.xiph.org/trunk/speex@14494 0101bb08-14d6-0310-b084-bc0e0c8e3800
-rw-r--r-- | include/speex/speex_preprocess.h | 4 | ||||
-rw-r--r-- | libspeex/preprocess.c | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/speex/speex_preprocess.h b/include/speex/speex_preprocess.h index a0d3aa3..ff6a112 100644 --- a/include/speex/speex_preprocess.h +++ b/include/speex/speex_preprocess.h @@ -182,6 +182,10 @@ int speex_preprocess_ctl(SpeexPreprocessState *st, int request, void *ptr); /** Get loudness */ #define SPEEX_PREPROCESS_GET_AGC_LOUDNESS 33 +/* Can't set gain */ +/** Get current gain (int32 percent) */ +#define SPEEX_PREPROCESS_GET_AGC_GAIN 35 + #ifdef __cplusplus } #endif diff --git a/libspeex/preprocess.c b/libspeex/preprocess.c index e32f0b4..36581d7 100644 --- a/libspeex/preprocess.c +++ b/libspeex/preprocess.c @@ -1175,6 +1175,9 @@ int speex_preprocess_ctl(SpeexPreprocessState *state, int request, void *ptr) case SPEEX_PREPROCESS_GET_AGC_LOUDNESS: (*(spx_int32_t*)ptr) = pow(st->loudness, 1.0/LOUDNESS_EXP); break; + case SPEEX_PREPROCESS_GET_AGC_GAIN: + (*(spx_int32_t*)ptr) = (spx_int32_t) (st->agc_gain * 100.f); + break; #endif default: |