Bug#331406: speex: Patch needed by iaxclient

Mikael Magnusson mikma at users.sourceforge.net
Sat Nov 5 11:14:52 UTC 2005


Package: speex
Version: 1.1.6-2
Severity: wishlist
Tags: patch

Hi,

this is a request to add a patch that is needed to build iaxlient with the
Debian speex library. The iaxclient package currently uses a statically
linked custom speex library.

Thanks,
Mikael Magnusson

diff -ur libspeex/preprocess.c /home/mikael/tmp/cvs/iaxclient/lib/libspeex/preprocess.c
--- libspeex/preprocess.c	2005-08-10 13:59:54.000000000 +0200
+++ /home/mikael/tmp/cvs/iaxclient/lib/libspeex/preprocess.c	2005-05-14 12:33:46.000000000 +0200
@@ -50,6 +50,9 @@
 #define SQRT_M_PI_2 0.88623
 #define LOUDNESS_EXP 2.5
 
+#define SPEEX_PROB_START_DEFAULT    0.35f
+#define SPEEX_PROB_CONTINUE_DEFAULT 0.20f
+
 #define NB_BANDS 8
 
 #define ZMIN .1
@@ -153,6 +156,9 @@
    st->reverb_decay = .5;
    st->reverb_level = .2;
 
+   st->speech_prob_start = SPEEX_PROB_START_DEFAULT;
+   st->speech_prob_continue = SPEEX_PROB_CONTINUE_DEFAULT;
+
    st->frame = (float*)speex_alloc(2*N*sizeof(float));
    st->ps = (float*)speex_alloc(N*sizeof(float));
    st->gain2 = (float*)speex_alloc(N*sizeof(float));
@@ -447,7 +453,8 @@
       st->speech_prob = p0/(1e-25f+p1+p0);
       /*fprintf (stderr, "%f %f %f ", tot_loudness, st->loudness2, st->speech_prob);*/
 
-      if (st->speech_prob>.35 || (st->last_speech < 20 && st->speech_prob>.1))
+      if (st->speech_prob > st->speech_prob_start 
+	  || (st->last_speech < 20 && st->speech_prob > st->speech_prob_continue))
       {
          is_speech = 1;
          st->last_speech = 0;
@@ -1037,7 +1044,29 @@
       (*(float*)ptr) = st->reverb_decay;
       break;
 
-      default:
+   case SPEEX_PREPROCESS_SET_PROB_START:
+      st->speech_prob_start = (*(float*)ptr);
+      if ( st->speech_prob_start > 1 )
+	  st->speech_prob_start = st->speech_prob_start / 100;
+      if ( st->speech_prob_start > 1 || st->speech_prob_start < 0 )
+	  st->speech_prob_start = SPEEX_PROB_START_DEFAULT;
+      break;
+   case SPEEX_PREPROCESS_GET_PROB_START:
+      (*(float*)ptr) = st->speech_prob_start ;
+      break;
+
+   case SPEEX_PREPROCESS_SET_PROB_CONTINUE:
+      st->speech_prob_continue = (*(float*)ptr);
+      if ( st->speech_prob_continue > 1 )
+	  st->speech_prob_continue = st->speech_prob_continue / 100;
+      if ( st->speech_prob_continue > 1 || st->speech_prob_continue < 0 )
+	  st->speech_prob_continue = SPEEX_PROB_CONTINUE_DEFAULT;
+      break;
+   case SPEEX_PREPROCESS_GET_PROB_CONTINUE:
+      (*(float*)ptr) = st->speech_prob_continue;
+      break;
+
+   default:
       speex_warning_int("Unknown speex_preprocess_ctl request: ", request);
       return -1;
    }
diff -ur include/speex/speex_preprocess.h /home/mikael/tmp/cvs/iaxclient/lib/libspeex/include/speex/speex_preprocess.h
--- include/speex/speex_preprocess.h	2005-07-25 11:16:04.000000000 +0200
+++ /home/mikael/tmp/cvs/iaxclient/lib/libspeex/include/speex/speex_preprocess.h	2005-05-14 12:33:46.000000000 +0200
@@ -55,6 +55,8 @@
    int    dereverb_enabled;
    float  reverb_decay;
    float  reverb_level;
+   float  speech_prob_start;
+   float  speech_prob_continue;
    
    float *frame;             /**< Processing frame (2*ps_size) */
    float *ps;                /**< Current power spectrum */
@@ -140,6 +142,13 @@
 #define SPEEX_PREPROCESS_SET_DEREVERB_DECAY 12
 #define SPEEX_PREPROCESS_GET_DEREVERB_DECAY 13
 
+#define SPEEX_PREPROCESS_SET_PROB_START 14
+#define SPEEX_PREPROCESS_GET_PROB_START 15
+
+#define SPEEX_PREPROCESS_SET_PROB_CONTINUE 16
+#define SPEEX_PREPROCESS_GET_PROB_CONTINUE 17
+
+
 #ifdef __cplusplus
 }
 #endif



-- System Information:
Debian Release: testing/unstable
  APT prefers stable
  APT policy: (871, 'stable'), (50, 'testing'), (30, 'unstable'), (10, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11-vserver-k7
Locale: LANG=sv_SE.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)






More information about the Pkg-voip-maintainers mailing list