mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
add speex 1.2beta1 to in tree libs
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3759 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
44
libs/speex/libspeex/testdenoise.c
Normal file
44
libs/speex/libspeex/testdenoise.c
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <speex/speex_preprocess.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define NN 160
|
||||
|
||||
int main()
|
||||
{
|
||||
short in[NN];
|
||||
int i;
|
||||
SpeexPreprocessState *st;
|
||||
int count=0;
|
||||
float f;
|
||||
|
||||
st = speex_preprocess_state_init(NN, 8000);
|
||||
i=1;
|
||||
speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DENOISE, &i);
|
||||
i=0;
|
||||
speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_AGC, &i);
|
||||
f=8000;
|
||||
speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_AGC_LEVEL, &f);
|
||||
i=0;
|
||||
speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DEREVERB, &i);
|
||||
f=.4;
|
||||
speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DEREVERB_DECAY, &f);
|
||||
f=.3;
|
||||
speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DEREVERB_LEVEL, &f);
|
||||
while (1)
|
||||
{
|
||||
int vad;
|
||||
fread(in, sizeof(short), NN, stdin);
|
||||
if (feof(stdin))
|
||||
break;
|
||||
vad = speex_preprocess(st, in, NULL);
|
||||
/*fprintf (stderr, "%d\n", vad);*/
|
||||
fwrite(in, sizeof(short), NN, stdout);
|
||||
count++;
|
||||
}
|
||||
speex_preprocess_state_destroy(st);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user