Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
cf40250f
Commit
cf40250f
authored
Jun 03, 2010
by
Alexandre Savard
Browse files
[#3481] Small echo canceller tuning
parent
a20de01f
Changes
1
Hide whitespace changes
Inline
Side-by-side
sflphone-common/src/audio/echocancel.cpp
View file @
cf40250f
...
@@ -93,6 +93,8 @@ EchoCancel::EchoCancel(int smplRate, int frameLength) : _samplingRate(smplRate),
...
@@ -93,6 +93,8 @@ EchoCancel::EchoCancel(int smplRate, int frameLength) : _samplingRate(smplRate),
_noiseState
=
speex_preprocess_state_init
(
_smplPerFrame
,
_samplingRate
);
_noiseState
=
speex_preprocess_state_init
(
_smplPerFrame
,
_samplingRate
);
int
i
=
1
;
int
i
=
1
;
speex_preprocess_ctl
(
_noiseState
,
SPEEX_PREPROCESS_SET_DENOISE
,
&
i
);
speex_preprocess_ctl
(
_noiseState
,
SPEEX_PREPROCESS_SET_DENOISE
,
&
i
);
i
=-
30
;
speex_preprocess_ctl
(
_noiseState
,
SPEEX_PREPROCESS_SET_NOISE_SUPPRESS
,
&
i
);
i
=
0
;
i
=
0
;
speex_preprocess_ctl
(
_noiseState
,
SPEEX_PREPROCESS_SET_AGC
,
&
i
);
speex_preprocess_ctl
(
_noiseState
,
SPEEX_PREPROCESS_SET_AGC
,
&
i
);
i
=
8000
;
i
=
8000
;
...
@@ -194,9 +196,9 @@ void EchoCancel::reset()
...
@@ -194,9 +196,9 @@ void EchoCancel::reset()
speex_preprocess_ctl
(
_noiseState
,
SPEEX_PREPROCESS_SET_AGC_LEVEL
,
&
i
);
speex_preprocess_ctl
(
_noiseState
,
SPEEX_PREPROCESS_SET_AGC_LEVEL
,
&
i
);
i
=
0
;
i
=
0
;
speex_preprocess_ctl
(
_noiseState
,
SPEEX_PREPROCESS_SET_DEREVERB
,
&
i
);
speex_preprocess_ctl
(
_noiseState
,
SPEEX_PREPROCESS_SET_DEREVERB
,
&
i
);
float
f
=
.0
;
float
f
=
0
.0
;
speex_preprocess_ctl
(
_noiseState
,
SPEEX_PREPROCESS_SET_DEREVERB_DECAY
,
&
f
);
speex_preprocess_ctl
(
_noiseState
,
SPEEX_PREPROCESS_SET_DEREVERB_DECAY
,
&
f
);
f
=
.0
;
f
=
0
.0
;
speex_preprocess_ctl
(
_noiseState
,
SPEEX_PREPROCESS_SET_DEREVERB_LEVEL
,
&
f
);
speex_preprocess_ctl
(
_noiseState
,
SPEEX_PREPROCESS_SET_DEREVERB_LEVEL
,
&
f
);
_spkrStoped
=
true
;
_spkrStoped
=
true
;
...
@@ -314,7 +316,7 @@ void EchoCancel::performEchoCancel(SFLDataFormat *micData, SFLDataFormat *spkrDa
...
@@ -314,7 +316,7 @@ void EchoCancel::performEchoCancel(SFLDataFormat *micData, SFLDataFormat *spkrDa
updateEchoCancel
(
micData
+
(
k
*
_smplPerSeg
),
spkrData
+
(
k
*
_smplPerSeg
));
updateEchoCancel
(
micData
+
(
k
*
_smplPerSeg
),
spkrData
+
(
k
*
_smplPerSeg
));
_spkrLevel
=
getMaxAmplitude
(
_avgSpkrLevelHist
,
_spkrHistoryLength
);
_spkrLevel
=
getMaxAmplitude
(
_avgSpkrLevelHist
,
_spkrHistoryLength
);
_micLevel
=
getMaxAmplitude
(
_avgMicLevelHist
,
_micHistoryLength
);
_micLevel
=
getMaxAmplitude
(
_avgMicLevelHist
,
_micHistoryLength
)
/
2
;
// _debug("_spkrLevel: (max): %d", _spkrLevel);
// _debug("_spkrLevel: (max): %d", _spkrLevel);
// _debug("_micLevel: (min): %d", _micLevel);
// _debug("_micLevel: (min): %d", _micLevel);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment