Simplified AEC available check

This commit is contained in:
Juha Heinanen
2025-03-30 13:00:46 +03:00
parent d4c7e3ade3
commit 795141f0d8
@@ -665,7 +665,7 @@ class BaresipService: Service() {
recorderSessionId = ev[1].toInt() recorderSessionId = ev[1].toInt()
Log.d(TAG, "got recorder sessionid $recorderSessionId") Log.d(TAG, "got recorder sessionid $recorderSessionId")
if (recorderSessionId != 0) { if (recorderSessionId != 0) {
if (!webrtcAec) { if (aecAvailable) {
aec = AcousticEchoCanceler.create(recorderSessionId) aec = AcousticEchoCanceler.create(recorderSessionId)
if (aec != null) { if (aec != null) {
if (!aec!!.getEnabled()) { if (!aec!!.getEnabled()) {
@@ -675,11 +675,10 @@ class BaresipService: Service() {
else else
Log.w(TAG, "Failed to enable AEC") Log.w(TAG, "Failed to enable AEC")
} }
else
Log.d(TAG, "AEC is already enabled")
} else } else
Log.w( Log.w(TAG, "Failed to create AEC for session $recorderSessionId")
TAG, "Failed to create AEC for session " +
"$recorderSessionId"
)
} }
if (agcAvailable) { if (agcAvailable) {
agc = AutomaticGainControl.create(recorderSessionId) agc = AutomaticGainControl.create(recorderSessionId)
@@ -1660,7 +1659,6 @@ class BaresipService: Service() {
private var agc: AutomaticGainControl? = null private var agc: AutomaticGainControl? = null
private val nsAvailable = NoiseSuppressor.isAvailable() private val nsAvailable = NoiseSuppressor.isAvailable()
private var ns: NoiseSuppressor? = null private var ns: NoiseSuppressor? = null
var webrtcAec = false
private var btAdapter: BluetoothAdapter? = null private var btAdapter: BluetoothAdapter? = null
private var recorderSessionId = 0 private var recorderSessionId = 0