~noskcaj/ubuntu/saucy/sflphone/merge-1.2.3-2

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.0.1/third_party/speex/libspeex/testdenoise.c

  • Committer: Jackson Doak
  • Date: 2013-07-10 21:04:46 UTC
  • mfrom: (20.1.3 sid)
  • Revision ID: noskcaj@ubuntu.com-20130710210446-y8f587vza807icr9
Properly merged from upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifdef HAVE_CONFIG_H
 
2
#include "config.h"
 
3
#endif
 
4
 
 
5
#include <speex/speex_preprocess.h>
 
6
#include <stdio.h>
 
7
 
 
8
#define NN 160
 
9
 
 
10
int main()
 
11
{
 
12
   short in[NN];
 
13
   int i;
 
14
   SpeexPreprocessState *st;
 
15
   int count=0;
 
16
   float f;
 
17
 
 
18
   st = speex_preprocess_state_init(NN, 8000);
 
19
   i=1;
 
20
   speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DENOISE, &i);
 
21
   i=0;
 
22
   speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_AGC, &i);
 
23
   i=8000;
 
24
   speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_AGC_LEVEL, &i);
 
25
   i=0;
 
26
   speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DEREVERB, &i);
 
27
   f=.0;
 
28
   speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DEREVERB_DECAY, &f);
 
29
   f=.0;
 
30
   speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DEREVERB_LEVEL, &f);
 
31
   while (1)
 
32
   {
 
33
      int vad;
 
34
      fread(in, sizeof(short), NN, stdin);
 
35
      if (feof(stdin))
 
36
         break;
 
37
      vad = speex_preprocess_run(st, in);
 
38
      /*fprintf (stderr, "%d\n", vad);*/
 
39
      fwrite(in, sizeof(short), NN, stdout);
 
40
      count++;
 
41
   }
 
42
   speex_preprocess_state_destroy(st);
 
43
   return 0;
 
44
}