Add independent compressor branch before radio VAD
This commit is contained in:
1 parent
389fca1de0
commit
cbee3da2c9
3 files changed
+241
-56
No files matched your search
@@ -59,6 +59,7 @@ class ConfigProvider(private val context: Context) {
|
||||
private val radioVadEnabledKey = intPreferencesKey("radio_vad_enabled")
|
||||
private val radioVadThresholdKey = intPreferencesKey("radio_vad_threshold")
|
||||
private val radioVadHangoverMsKey = intPreferencesKey("radio_vad_hangover_ms")
|
||||
private val radioVadCompressorMaxGainDbKey = intPreferencesKey("radio_vad_compressor_max_gain_db")
|
||||
private val radioVolumePttKey = booleanPreferencesKey("radio_volume_ptt")
|
||||
private val radioOverlayKey = booleanPreferencesKey("radio_overlay")
|
||||
private val radioMicSourceKey = intPreferencesKey("radio_mic_source")
|
||||
@@ -150,6 +151,7 @@ class ConfigProvider(private val context: Context) {
|
||||
key == "radio.vad_enabled" -> context.dataStore.data.first()[radioVadEnabledKey] ?: 0
|
||||
key == "radio.vad_threshold" -> context.dataStore.data.first()[radioVadThresholdKey] ?: 50
|
||||
key == "radio.vad_hangover_ms" -> context.dataStore.data.first()[radioVadHangoverMsKey] ?: 200
|
||||
key == "radio.vad_compressor_max_gain_db" -> context.dataStore.data.first()[radioVadCompressorMaxGainDbKey] ?: 15
|
||||
key == "radio.opus_mode" -> context.dataStore.data.first()[radioOpusModeKey] ?: 0
|
||||
key == "radio.opus_bitrate" -> context.dataStore.data.first()[radioOpusBitrateKey] ?: 32
|
||||
key == "radio.capture_stereo" -> context.dataStore.data.first()[radioCaptureStereoKey] ?: 0
|
||||
@@ -191,6 +193,7 @@ class ConfigProvider(private val context: Context) {
|
||||
"radio.vad_enabled" -> prefs[radioVadEnabledKey] = value.toIntOrNull() ?: 0
|
||||
"radio.vad_threshold" -> prefs[radioVadThresholdKey] = value.toIntOrNull() ?: 50
|
||||
"radio.vad_hangover_ms" -> prefs[radioVadHangoverMsKey] = value.toIntOrNull() ?: 200
|
||||
"radio.vad_compressor_max_gain_db" -> prefs[radioVadCompressorMaxGainDbKey] = (value.toIntOrNull() ?: 15).coerceIn(1, 60)
|
||||
"radio.opus_mode" -> prefs[radioOpusModeKey] = value.toIntOrNull() ?: 0
|
||||
"radio.opus_bitrate" -> prefs[radioOpusBitrateKey] = value.toIntOrNull() ?: 32
|
||||
"radio.capture_stereo" -> prefs[radioCaptureStereoKey] = value.toIntOrNull() ?: 0
|
||||
@@ -559,6 +562,7 @@ class ConfigProvider(private val context: Context) {
|
||||
appendLine("radio_vad_enabled=${getInt("radio.vad_enabled")}")
|
||||
appendLine("radio_vad_threshold=${getInt("radio.vad_threshold")}")
|
||||
appendLine("radio_vad_hangover_ms=${getInt("radio.vad_hangover_ms")}")
|
||||
appendLine("radio_vad_compressor_max_gain_db=${getInt("radio.vad_compressor_max_gain_db")}")
|
||||
appendLine("radio_opus_mode=$radioOpusMode")
|
||||
appendLine("radio_opus_bitrate=$radioOpusBitrate")
|
||||
appendLine("radio_capture_stereo=$radioCaptureStereo")
|
||||
|
||||
Reference in new issue
Block a user