From: <sb...@us...> - 2008-02-05 23:56:30
|
Revision: 1341 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1341&view=rev Author: sbalea Date: 2008-02-05 15:56:33 -0800 (Tue, 05 Feb 2008) Log Message: ----------- Make iaxclient work (and require!!!) speex-1.2beta3 Modified Paths: -------------- trunk/configure.ac trunk/lib/Makefile.am trunk/lib/audio_encode.c trunk/m4/speex.m4 Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-02-05 20:29:40 UTC (rev 1340) +++ trunk/configure.ac 2008-02-05 23:56:33 UTC (rev 1341) @@ -235,6 +235,12 @@ obtain a copy. ])) +PKG_CHECK_MODULES(SPEEXDSP, [speexdsp >= 1.2],,AC_MSG_ERROR([ + speexdsp is required to build this package! + please see http://www.xiph.org/ for how to + obtain a copy. +])) + has_theora=no if test ! x$with_theora = xno; then PKG_CHECK_MODULES(THEORA, [theora >= 1.0alpha7],has_theora=yes) Modified: trunk/lib/Makefile.am =================================================================== --- trunk/lib/Makefile.am 2008-02-05 20:29:40 UTC (rev 1340) +++ trunk/lib/Makefile.am 2008-02-05 23:56:33 UTC (rev 1341) @@ -12,6 +12,7 @@ AM_CFLAGS = \ $(PTHREAD_CFLAGS) \ $(SPEEX_CFLAGS) \ + $(SPEEXDSP_CFLAGS) \ $(IAX2_CFLAGS) \ $(PORTAUDIO_CFLAGS) @@ -25,7 +26,8 @@ $(PTHREAD_LIBS) \ $(IAX2_LIBS) \ $(PORTAUDIO_LIBS) \ - $(SPEEX_LIBS) + $(SPEEX_LIBS) \ + $(SPEEXDSP_LIBS) AM_LDFLAGS = \ -no-undefined \ Modified: trunk/lib/audio_encode.c =================================================================== --- trunk/lib/audio_encode.c 2008-02-05 20:29:40 UTC (rev 1340) +++ trunk/lib/audio_encode.c 2008-02-05 23:56:33 UTC (rev 1341) @@ -105,10 +105,14 @@ i = (iaxci_filters & IAXC_FILTER_DENOISE) ? 1 : 0; speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DENOISE, &i); - /* make vad more sensitive */ - i = 30; + /* + * 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 = 7; + i = 20; speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_PROB_CONTINUE, &i); } @@ -153,10 +157,10 @@ /* Analog AGC: Bring speex AGC gain out to mixer, with lots of hysteresis */ /* use a higher continuation threshold for AAGC than for VAD itself */ if ( !silent && - iaxci_silence_threshold != 0.0f && - (iaxci_filters & IAXC_FILTER_AGC) && - (iaxci_filters & IAXC_FILTER_AAGC) && - st->speech_prob > 0.20f ) + iaxci_silence_threshold != 0.0f && + (iaxci_filters & IAXC_FILTER_AGC) && + (iaxci_filters & IAXC_FILTER_AAGC) + ) { static int i = 0; @@ -164,8 +168,8 @@ if ( (i & 0x3f) == 0 ) { - const float loudness = st->loudness2; - + const float loudness; + speex_preprocess_ctl(st, SPEEX_PREPROCESS_GET_AGC_LOUDNESS, &loudness); if ( loudness > 8000.0f || loudness < 4000.0f ) { const float level = iaxc_input_level_get(); Modified: trunk/m4/speex.m4 =================================================================== --- trunk/m4/speex.m4 2008-02-05 20:29:40 UTC (rev 1340) +++ trunk/m4/speex.m4 2008-02-05 23:56:33 UTC (rev 1341) @@ -41,7 +41,7 @@ SPEEX_LIBS="-L$prefix/lib" fi - SPEEX_LIBS="$SPEEX_LIBS -lspeex" + SPEEX_LIBS="$SPEEX_LIBS -lspeex -lspeexdsp" if test "x$speex_includes" != "x" ; then SPEEX_CFLAGS="-I$speex_includes" @@ -60,7 +60,7 @@ LIBS="$LIBS $SPEEX_LIBS" dnl Check for a working version of speex that is of the right version. -min_speex_version=ifelse([$1], ,1.0.0,$1) +min_speex_version=ifelse([$1], ,1.2.0,$1) AC_MSG_CHECKING(for speex headers version >= $min_speex_version) #no_speex="" speex_min_major_version=`echo $min_speex_version | \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |