Raise comma four alert volume

This commit is contained in:
Isaac Barham
2026-08-28 19:38:48 -04:00
parent 70fa5d0fca
commit 26e4889fcb
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ sound_list: dict[int, tuple[str, int | None, float]] = {
def calculate_volume_for_device(weighted_db: float, device_type: str) -> float:
ambient_db = 30 if device_type in ("mici", "tizi") else 26
volume_base = 10 if device_type in ("mici", "tizi") else 20
volume_boost = 1.2 if device_type == "mici" else 1.0
volume_boost = 1.5 if device_type == "mici" else 1.0
volume = ((weighted_db - ambient_db) / DB_SCALE) * (MAX_VOLUME - MIN_VOLUME) + MIN_VOLUME
return min(MAX_VOLUME, volume_boost * math.pow(volume_base, (np.clip(volume, MIN_VOLUME, MAX_VOLUME) - 1)))
+2 -2
View File
@@ -11,12 +11,12 @@ AudibleAlert = log.SelfdriveState.AudibleAlert
class TestSoundd(OpenpilotTestCase):
def test_comma_four_volume_is_20_percent_louder_than_comma_three_x(self):
def test_comma_four_volume_is_50_percent_louder_than_comma_three_x(self):
for weighted_db in (20.0, 30.0, 40.0, 50.0):
with self.subTest(weighted_db=weighted_db):
comma_three_x_volume = calculate_volume_for_device(weighted_db, "tizi")
comma_four_volume = calculate_volume_for_device(weighted_db, "mici")
assert comma_four_volume == min(1.0, comma_three_x_volume * 1.2)
assert comma_four_volume == min(1.0, comma_three_x_volume * 1.5)
def test_milestone_chime_uses_ui_milestone_event(self):
soundd = Soundd()