This commit is contained in:
rav4kumar
2025-03-23 12:36:48 -07:00
parent 9437bf5952
commit c2bffddc05
+7 -1
View File
@@ -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))