From 795141f0d8e3efe6233b7de81c70116f455d5d1d Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Sun, 30 Mar 2025 13:00:46 +0300 Subject: [PATCH] Simplified AEC available check --- .../main/kotlin/com/tutpro/baresip/BaresipService.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt index be92df10..117f8bbd 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt @@ -665,7 +665,7 @@ class BaresipService: Service() { recorderSessionId = ev[1].toInt() Log.d(TAG, "got recorder sessionid $recorderSessionId") if (recorderSessionId != 0) { - if (!webrtcAec) { + if (aecAvailable) { aec = AcousticEchoCanceler.create(recorderSessionId) if (aec != null) { if (!aec!!.getEnabled()) { @@ -675,11 +675,10 @@ class BaresipService: Service() { else Log.w(TAG, "Failed to enable AEC") } + else + Log.d(TAG, "AEC is already enabled") } else - Log.w( - TAG, "Failed to create AEC for session " + - "$recorderSessionId" - ) + Log.w(TAG, "Failed to create AEC for session $recorderSessionId") } if (agcAvailable) { agc = AutomaticGainControl.create(recorderSessionId) @@ -1660,7 +1659,6 @@ class BaresipService: Service() { private var agc: AutomaticGainControl? = null private val nsAvailable = NoiseSuppressor.isAvailable() private var ns: NoiseSuppressor? = null - var webrtcAec = false private var btAdapter: BluetoothAdapter? = null private var recorderSessionId = 0