Skip to content

Commit 88567b8

Browse files
committed
allow disabling AEC at runtime with env
Signed-off-by: Yujong Lee <yujonglee.dev@gmail.com>
1 parent fa6a531 commit 88567b8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

crates/listener-core/src/actors/source/pipeline.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::{
22
collections::{HashMap, VecDeque},
3+
env,
34
sync::Arc,
45
time::{Duration, Instant},
56
};
@@ -35,9 +36,13 @@ impl Pipeline {
3536

3637
pub(super) fn new(runtime: Arc<dyn ListenerRuntime>, session_id: String) -> Self {
3738
Self {
38-
aec: AEC::new()
39-
.map_err(|e| tracing::warn!(error = ?e, "aec_init_failed"))
40-
.ok(),
39+
aec: if env::var("NO_AEC").as_deref() == Ok("1") {
40+
None
41+
} else {
42+
AEC::new()
43+
.map_err(|e| tracing::warn!(error = ?e, "aec_init_failed"))
44+
.ok()
45+
},
4146
joiner: Joiner::new(),
4247
amplitude: AmplitudeEmitter::new(runtime, session_id),
4348
audio_buffer: AudioBuffer::new(MAX_BUFFER_CHUNKS),

0 commit comments

Comments
 (0)