xref: /third_party/pulseaudio/speex/libspeexdsp/testdenoise.c (revision 53a5a1b3)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/pulseaudio/speex/libspeexdsp/
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
10int 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}
45

Indexes created Thu Nov 07 10:32:03 CST 2024