feat(audio): practice hype calls and leader calls in qualifying and finals (1.61.0)

This commit is contained in:
larssand committed 2026-11-05 08:19:45 +01:00
1 parent f602778895
commit 94ec278f53
13 files changed
+334 -9

No files matched your search

+15 -2
View File
@@ -138,12 +138,16 @@ test("after the count-down's 3 and the tone call it is quiet until the tone 1-3
}
});
test("during a race only the passing tone plays by default - no names, personal bests or leader calls", () => {
test("during a race only the passing tone and leader calls play by default - no personal bests", () => {
const race = { type: "heat" };
assert.equal(normalizeRaceAudioSettings({}).raceCallouts, "passing");
["personal_best", "fastest_lap", "track_record", "new_leader", "position_gain", "position_loss"].forEach((key) => {
["personal_best", "fastest_lap", "track_record", "position_gain", "position_loss"].forEach((key) => {
assert.equal(isSilencedDuringRace(key, {}, race), true, key);
});
assert.equal(isSilencedDuringRace("new_leader", {}, race), false, "leader change is called by default");
assert.equal(isSilencedDuringRace("leader_update", {}, race), false);
assert.equal(isSilencedDuringRace("leader_update", { raceLeaderCalls: "change" }, race), true);
assert.equal(isSilencedDuringRace("new_leader", { raceLeaderCalls: "off" }, race), true);
["transponder_pass", "final_lap", "one_minute_remaining", "race_finished", "race_winner", "clock_running"].forEach((key) => {
assert.equal(isSilencedDuringRace(key, {}, race), false, `${key} is not a per-passing call`);
});
@@ -333,3 +337,12 @@ test("lap times are spoken as seconds with hundredths, no leading zero minute",
assert.equal(formatSpokenLapTime(65320, "sv"), "1 minut 5,32");
assert.equal(formatSpokenLapTime(125000, "en"), "2 minutes 5.00");
});
test("practice hype calls only sound in practice and can be turned off", () => {
assert.equal(isSilencedDuringRace("practice_lap_milestone", {}, { type: "open_practice" }), false);
assert.equal(isSilencedDuringRace("practice_lap_milestone", {}, { type: "practice" }), false);
["qualification", "heat", "final", "team_race"].forEach((type) => {
assert.equal(isSilencedDuringRace("practice_duel", { raceCallouts: "full" }, { type }), true, type);
});
assert.equal(isSilencedDuringRace("practice_close_to_best", { practiceHype: false }, { type: "open_practice" }), true);
});