From: <jpg...@us...> - 2008-04-15 22:23:51
|
Revision: 1410 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1410&view=rev Author: jpgrayson Date: 2008-04-15 15:23:20 -0700 (Tue, 15 Apr 2008) Log Message: ----------- Add IAXC_FILTER_DEREVERB flag to enable/disable speexdsp's dereverb preprocessor feature. Note that currently speexdsp's dereverb feature doesn't do much. Modified Paths: -------------- trunk/lib/audio_encode.c trunk/lib/iaxclient.h Modified: trunk/lib/audio_encode.c =================================================================== --- trunk/lib/audio_encode.c 2008-04-15 22:21:25 UTC (rev 1409) +++ trunk/lib/audio_encode.c 2008-04-15 22:23:20 UTC (rev 1410) @@ -104,12 +104,14 @@ speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_AGC, &i); i = (iaxci_filters & IAXC_FILTER_DENOISE) ? 1 : 0; speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DENOISE, &i); + i = (iaxci_filters & IAXC_FILTER_DEREVERB) ? 1 : 0; + speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DEREVERB, &i); /* - * We can tweak these parameters to play with VAD sensitivity. - * For now, we use the default values since it seems they are a good starting point. - * However, if need be, this is the code that needs to change - */ + * We can tweak these parameters to play with VAD sensitivity. + * For now, we use the default values since it seems they are a good starting point. + * However, if need be, this is the code that needs to change + */ i = 35; speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_PROB_START, &i); i = 20; @@ -149,8 +151,8 @@ calculate_level((short *)audio, len, &input_level); - /* only preprocess if we're interested in VAD, AGC, or DENOISE */ - if ( (iaxci_filters & (IAXC_FILTER_DENOISE | IAXC_FILTER_AGC)) || + /* go through the motions only if we need at least one of the preprocessor filters */ + if ( (iaxci_filters & (IAXC_FILTER_DENOISE | IAXC_FILTER_AGC | IAXC_FILTER_DEREVERB)) || iaxci_silence_threshold > 0.0f ) silent = !speex_preprocess(st, (spx_int16_t *)audio, NULL); @@ -350,7 +352,8 @@ if ( format == 0 ) { - fprintf(stderr, "audio_decode_audio: Format is zero (should't happen)!\n"); + fprintf(stderr, "audio_decode_audio: Format is zero " + "(should not happen)!\n"); return -1; } Modified: trunk/lib/iaxclient.h =================================================================== --- trunk/lib/iaxclient.h 2008-04-15 22:21:25 UTC (rev 1409) +++ trunk/lib/iaxclient.h 2008-04-15 22:23:20 UTC (rev 1410) @@ -1063,6 +1063,7 @@ #define IAXC_FILTER_ECHO (1<<2) /*!< Echo cancellation filter */ #define IAXC_FILTER_AAGC (1<<3) /*!< Analog (mixer-based) Automatic Gain Control */ #define IAXC_FILTER_CN (1<<4) /*!< Send Comfort Noise (CN) frames when silence is detected */ +#define IAXC_FILTER_DEREVERB (1<<5) /*!< Reverb reduction filter */ /*! Returns the set of audio filters being applied. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |