Load webrtc_aecm module only if device does not provide aec
This commit is contained in:
@@ -638,24 +638,12 @@ class BaresipService: Service() {
|
|||||||
if (ev[0] == "recorder sessionid") {
|
if (ev[0] == "recorder sessionid") {
|
||||||
val sessionId = ev[1].toInt()
|
val sessionId = ev[1].toInt()
|
||||||
Log.d(TAG, "got recorder sessionid $sessionId")
|
Log.d(TAG, "got recorder sessionid $sessionId")
|
||||||
if (AcousticEchoCanceler.isAvailable()) {
|
if (aec)
|
||||||
Log.i(TAG, "AcousticEchoCanceler IS available")
|
|
||||||
AcousticEchoCanceler.create(sessionId)
|
AcousticEchoCanceler.create(sessionId)
|
||||||
} else {
|
if (agc)
|
||||||
Log.i(TAG, "AcousticEchoCanceler IS NOT available")
|
|
||||||
}
|
|
||||||
if (AutomaticGainControl.isAvailable()) {
|
|
||||||
Log.i(TAG, "AutomaticGainControl IS available")
|
|
||||||
AutomaticGainControl.create(sessionId)
|
AutomaticGainControl.create(sessionId)
|
||||||
} else {
|
if (ns)
|
||||||
Log.i(TAG, "AutomaticGainControl IS NOT available")
|
|
||||||
}
|
|
||||||
if (NoiseSuppressor.isAvailable()) {
|
|
||||||
Log.i(TAG, "NoiseSuppressor IS available")
|
|
||||||
NoiseSuppressor.create(sessionId)
|
NoiseSuppressor.create(sessionId)
|
||||||
} else {
|
|
||||||
Log.i(TAG, "NoiseSuppressor IS NOT available")
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1641,7 +1629,9 @@ class BaresipService: Service() {
|
|||||||
// <aor, password> of those accounts that have auth username without auth password
|
// <aor, password> of those accounts that have auth username without auth password
|
||||||
val aorPasswords = mutableMapOf<String, String>()
|
val aorPasswords = mutableMapOf<String, String>()
|
||||||
var audioFocusRequest: AudioFocusRequestCompat? = null
|
var audioFocusRequest: AudioFocusRequestCompat? = null
|
||||||
|
var aec = AcousticEchoCanceler.isAvailable()
|
||||||
|
var agc = AutomaticGainControl.isAvailable()
|
||||||
|
private var ns = NoiseSuppressor.isAvailable()
|
||||||
private var btAdapter: BluetoothAdapter? = null
|
private var btAdapter: BluetoothAdapter? = null
|
||||||
|
|
||||||
fun requestAudioFocus(ctx: Context): Boolean {
|
fun requestAudioFocus(ctx: Context): Boolean {
|
||||||
|
|||||||
@@ -154,11 +154,11 @@ object Config {
|
|||||||
if ("${module}.so" in previousModules)
|
if ("${module}.so" in previousModules)
|
||||||
config = "${config}module ${module}.so\n"
|
config = "${config}module ${module}.so\n"
|
||||||
|
|
||||||
if ("webrtc_aecm.so" in previousModules)
|
if (!BaresipService.aec && "webrtc_aecm.so" in previousModules)
|
||||||
config = "${config}module webrtc_aecm.so\n"
|
config = "${config}module webrtc_aecm.so\n"
|
||||||
|
|
||||||
val micGain = previousVariable("augain")
|
val micGain = previousVariable("augain")
|
||||||
config = if (micGain == "" || micGain == "1.0")
|
config = if (!BaresipService.agc && (micGain == "" || micGain == "1.0"))
|
||||||
"${config}augain 1.0\n"
|
"${config}augain 1.0\n"
|
||||||
else
|
else
|
||||||
"${config}module augain.so\naugain $micGain\n"
|
"${config}module augain.so\naugain $micGain\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user