Silent Mode

Added toggle to mute all sounds while driving for a completely quiet openpilot driving experience.
This commit is contained in:
FrogAi
2024-01-12 22:39:30 -07:00
parent ee56bdef0a
commit fa98b0505f
4 changed files with 4 additions and 1 deletions

View File

@@ -155,7 +155,7 @@ class Soundd:
if sm.updated['microphone'] and self.current_alert == AudibleAlert.none: # only update volume filter when not playing alert
self.spl_filter_weighted.update(sm["microphone"].soundPressureWeightedDb)
self.current_volume = self.calculate_volume(float(self.spl_filter_weighted.x))
self.current_volume = self.calculate_volume(float(self.spl_filter_weighted.x)) if not self.silent_mode else 0
self.get_audible_alert(sm)
@@ -168,6 +168,7 @@ class Soundd:
self.update_frogpilot_params()
def update_frogpilot_params(self):
self.silent_mode = self.params.get_bool("SilentMode")
custom_theme = self.params.get_bool("CustomTheme")
custom_sounds = self.params.get_int("CustomSounds") if custom_theme else 0