2 This file is part of PulseAudio.
4 Copyright 2010 Arun Raghavan <arun.raghavan@collabora.co.uk>
6 PulseAudio is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published
8 by the Free Software Foundation; either version 2.1 of the License,
9 or (at your option) any later version.
11 PulseAudio is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public License
17 along with PulseAudio; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 #ifndef fooechocancelhfoo
23 #define fooechocancelhfoo
29 #include <pulse/sample.h>
30 #include <pulse/channelmap.h>
31 #include <pulsecore/core.h>
32 #include <pulsecore/macro.h>
34 #include <speex/speex_echo.h>
35 #include <speex/speex_preprocess.h>
38 /* Common data structures */
40 typedef struct pa_echo_canceller_params pa_echo_canceller_params
;
42 struct pa_echo_canceller_params
{
45 SpeexEchoState
*state
;
51 /* each canceller-specific structure goes here */
55 typedef struct pa_echo_canceller pa_echo_canceller
;
57 struct pa_echo_canceller
{
58 pa_bool_t (*init
) (pa_core
*c
,
59 pa_echo_canceller
*ec
,
60 pa_sample_spec
*source_ss
,
61 pa_channel_map
*source_map
,
62 pa_sample_spec
*sink_ss
,
63 pa_channel_map
*sink_map
,
66 void (*run
) (pa_echo_canceller
*ec
, const uint8_t *rec
, const uint8_t *play
, uint8_t *out
);
67 void (*done
) (pa_echo_canceller
*ec
);
69 pa_echo_canceller_params params
;
73 pa_bool_t echo_suppress
;
74 int32_t echo_suppress_attenuation
;
75 int32_t echo_suppress_attenuation_active
;
76 SpeexPreprocessState
*pp_state
;
79 /* Speex canceller functions */
80 pa_bool_t
pa_speex_ec_init(pa_core
*c
, pa_echo_canceller
*ec
,
81 pa_sample_spec
*source_ss
, pa_channel_map
*source_map
,
82 pa_sample_spec
*sink_ss
, pa_channel_map
*sink_map
,
83 uint32_t *blocksize
, const char *args
);
84 void pa_speex_ec_run(pa_echo_canceller
*ec
, const uint8_t *rec
, const uint8_t *play
, uint8_t *out
);
85 void pa_speex_ec_done(pa_echo_canceller
*ec
);
87 /* Adrian Andre's echo canceller */
88 pa_bool_t
pa_adrian_ec_init(pa_core
*c
, pa_echo_canceller
*ec
,
89 pa_sample_spec
*source_ss
, pa_channel_map
*source_map
,
90 pa_sample_spec
*sink_ss
, pa_channel_map
*sink_map
,
91 uint32_t *blocksize
, const char *args
);
92 void pa_adrian_ec_run(pa_echo_canceller
*ec
, const uint8_t *rec
, const uint8_t *play
, uint8_t *out
);
93 void pa_adrian_ec_done(pa_echo_canceller
*ec
);
95 #endif /* fooechocancelhfoo */