mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-13 13:03:44 +08:00
sunny
This commit is contained in:
@@ -66,6 +66,12 @@ class Soundd(QuietMode):
|
||||
|
||||
self.spl_filter_weighted = FirstOrderFilter(0, 2.5, FILTER_DT, initialized=False)
|
||||
|
||||
def load_param(self):
|
||||
super().load_param()
|
||||
|
||||
def should_play_sound(self, current_alert):
|
||||
return super().should_play_sound(current_alert)
|
||||
|
||||
def load_sounds(self):
|
||||
self.loaded_sounds: dict[int, np.ndarray] = {}
|
||||
|
||||
@@ -148,7 +154,7 @@ class Soundd(QuietMode):
|
||||
while True:
|
||||
sm.update(0)
|
||||
|
||||
if sm.updated['microphone'] and self.current_alert == AudibleAlert.none: # only update volume filter when not playing alert
|
||||
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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user