Fixed bug in configuring audio modules in audio settings
This commit is contained in:
@@ -210,13 +210,17 @@ class AudioActivity : AppCompatActivity() {
|
|||||||
save = true
|
save = true
|
||||||
}
|
}
|
||||||
|
|
||||||
var gain = micGain.text.toString().trim()
|
var gain = "1.0"
|
||||||
|
if (!BaresipService.agc) {
|
||||||
|
gain = micGain.text.toString().trim()
|
||||||
if (!gain.contains("."))
|
if (!gain.contains("."))
|
||||||
gain = "$gain.0"
|
gain = "$gain.0"
|
||||||
if (gain != oldMicGain) {
|
if (gain != oldMicGain) {
|
||||||
if (!checkMicGain(gain)) {
|
if (!checkMicGain(gain)) {
|
||||||
Utils.alertView(this, getString(R.string.notice),
|
Utils.alertView(
|
||||||
"${getString(R.string.invalid_microphone_gain)}: $gain.")
|
this, getString(R.string.notice),
|
||||||
|
"${getString(R.string.invalid_microphone_gain)}: $gain."
|
||||||
|
)
|
||||||
micGain.setText(oldMicGain)
|
micGain.setText(oldMicGain)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -227,8 +231,10 @@ class AudioActivity : AppCompatActivity() {
|
|||||||
} else {
|
} else {
|
||||||
if (oldMicGain == "1.0") {
|
if (oldMicGain == "1.0") {
|
||||||
if (Api.module_load("augain") != 0) {
|
if (Api.module_load("augain") != 0) {
|
||||||
Utils.alertView(this, getString(R.string.error),
|
Utils.alertView(
|
||||||
getString(R.string.failed_to_load_module))
|
this, getString(R.string.error),
|
||||||
|
getString(R.string.failed_to_load_module)
|
||||||
|
)
|
||||||
micGain.setText(oldMicGain)
|
micGain.setText(oldMicGain)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -239,6 +245,7 @@ class AudioActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
save = true
|
save = true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (speakerPhone.isChecked != BaresipService.speakerPhone) {
|
if (speakerPhone.isChecked != BaresipService.speakerPhone) {
|
||||||
BaresipService.speakerPhone = speakerPhone.isChecked
|
BaresipService.speakerPhone = speakerPhone.isChecked
|
||||||
@@ -294,6 +301,7 @@ class AudioActivity : AppCompatActivity() {
|
|||||||
save = true
|
save = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!BaresipService.aec) {
|
||||||
if (aec.isChecked != oldAec) {
|
if (aec.isChecked != oldAec) {
|
||||||
if (aec.isChecked) {
|
if (aec.isChecked) {
|
||||||
Config.addVariable("module", "webrtc_aecm.so")
|
Config.addVariable("module", "webrtc_aecm.so")
|
||||||
@@ -301,8 +309,10 @@ class AudioActivity : AppCompatActivity() {
|
|||||||
restart = true
|
restart = true
|
||||||
} else {
|
} else {
|
||||||
if (Api.module_load("webrtc_aecm.so") != 0) {
|
if (Api.module_load("webrtc_aecm.so") != 0) {
|
||||||
Utils.alertView(this, getString(R.string.error),
|
Utils.alertView(
|
||||||
getString(R.string.failed_to_load_module))
|
this, getString(R.string.error),
|
||||||
|
getString(R.string.failed_to_load_module)
|
||||||
|
)
|
||||||
aec.isChecked = false
|
aec.isChecked = false
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -313,6 +323,7 @@ class AudioActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
save = true
|
save = true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val audioDelay = audioDelay.text.toString().trim()
|
val audioDelay = audioDelay.text.toString().trim()
|
||||||
if (audioDelay != BaresipService.audioDelay.toString()) {
|
if (audioDelay != BaresipService.audioDelay.toString()) {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ object Config {
|
|||||||
if (!File(configPath).exists()) {
|
if (!File(configPath).exists()) {
|
||||||
for (module in AudioActivity.audioModules)
|
for (module in AudioActivity.audioModules)
|
||||||
config = "${config}module ${module}.so\n"
|
config = "${config}module ${module}.so\n"
|
||||||
|
if (!BaresipService.aec)
|
||||||
config = "${config}module webrtc_aecm.so\n"
|
config = "${config}module webrtc_aecm.so\n"
|
||||||
previousConfig = config
|
previousConfig = config
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user