Fold the Android noise suppression toggle into its slider, and let the muted-talk beep be turned off
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,7 +38,7 @@ import com.ts3client.audio.InputLevel
|
|||||||
import com.ts3client.config.Settings
|
import com.ts3client.config.Settings
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
private val DENOISE_LEVELS = listOf("6 dB", "12 dB", "18 dB", "21 dB")
|
private val DENOISE_LEVELS = listOf("Off", "6 dB", "12 dB", "18 dB", "21 dB")
|
||||||
|
|
||||||
/** Audio devices, transmission, voice activation, processing and playback. */
|
/** Audio devices, transmission, voice activation, processing and playback. */
|
||||||
@Composable
|
@Composable
|
||||||
@@ -50,8 +50,8 @@ fun SoundSettingsScreen(vm: SessionController, onBack: () -> Unit) {
|
|||||||
}
|
}
|
||||||
var inputMode by remember { mutableStateOf(settings.inputMode) }
|
var inputMode by remember { mutableStateOf(settings.inputMode) }
|
||||||
var vadMode by remember { mutableStateOf(settings.vadMode) }
|
var vadMode by remember { mutableStateOf(settings.vadMode) }
|
||||||
var denoise by remember { mutableStateOf(settings.denoise) }
|
|
||||||
var agc by remember { mutableStateOf(settings.agc) }
|
var agc by remember { mutableStateOf(settings.agc) }
|
||||||
|
var mutedTalkWarning by remember { mutableStateOf(settings.mutedTalkWarning) }
|
||||||
var threshold by remember { mutableFloatStateOf(settings.vadThresholdDb.toFloat()) }
|
var threshold by remember { mutableFloatStateOf(settings.vadThresholdDb.toFloat()) }
|
||||||
var inputDevice by remember { mutableStateOf(settings.inputDevice) }
|
var inputDevice by remember { mutableStateOf(settings.inputDevice) }
|
||||||
var outputDevice by remember { mutableStateOf(settings.outputDevice) }
|
var outputDevice by remember { mutableStateOf(settings.outputDevice) }
|
||||||
@@ -127,13 +127,13 @@ fun SoundSettingsScreen(vm: SessionController, onBack: () -> Unit) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Section("Processing")
|
Section("Processing")
|
||||||
Toggle("Noise suppression", denoise) {
|
val suppression = if (settings.denoise) settings.denoiserLevel + 1 else 0
|
||||||
denoise = it
|
Level("Noise suppression", suppression.toFloat(), 0f..DENOISE_LEVELS.lastIndex.toFloat(),
|
||||||
change { this.denoise = it }
|
{ DENOISE_LEVELS[it.roundToInt()] }, steps = DENOISE_LEVELS.lastIndex - 1) {
|
||||||
}
|
val step = it.roundToInt()
|
||||||
if (denoise) {
|
change {
|
||||||
Level("Suppression", settings.denoiserLevel.toFloat(), 0f..3f, { DENOISE_LEVELS[it.roundToInt()] }, steps = 2) {
|
denoise = step > 0
|
||||||
change { denoiserLevel = it.roundToInt() }
|
if (step > 0) denoiserLevel = step - 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Toggle("Automatic gain control", agc) {
|
Toggle("Automatic gain control", agc) {
|
||||||
@@ -164,6 +164,10 @@ fun SoundSettingsScreen(vm: SessionController, onBack: () -> Unit) {
|
|||||||
Level("Volume", settings.soundVolume.toFloat(), 0f..1f, { "${(it * 100).roundToInt()} %" }) {
|
Level("Volume", settings.soundVolume.toFloat(), 0f..1f, { "${(it * 100).roundToInt()} %" }) {
|
||||||
change { soundVolume = it.toDouble() }
|
change { soundVolume = it.toDouble() }
|
||||||
}
|
}
|
||||||
|
Toggle("Beep when talking while muted", mutedTalkWarning) {
|
||||||
|
mutedTalkWarning = it
|
||||||
|
change { this.mutedTalkWarning = it }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user