Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions frontend/src/ts/controllers/sound-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,11 @@ export async function playTimeWarning(): Promise<void> {
soundToPlay.play();
}

export async function clearAllSounds(): Promise<void> {
const Howl = (await gethowler()).Howler;
Howl.stop();
}

function playNote(
codeOverride?: string,
oscillatorTypeOverride?: SupportedOscillatorTypes,
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/ts/test/test-logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import * as CustomText from "./custom-text";
import * as CustomTextState from "../states/custom-text-name";
import * as TestStats from "./test-stats";
import * as PractiseWords from "./practise-words";
import * as SoundController from "../controllers/sound-controller";
import * as ShiftTracker from "./shift-tracker";
import * as AltTracker from "./alt-tracker";
import * as Focus from "./focus";
Expand Down Expand Up @@ -297,6 +298,7 @@ export function restart(options = {} as RestartOptions): void {
TestUI.reset();
CompositionState.setComposing(false);
CompositionState.setData("");
void SoundController.clearAllSounds();

if (TestState.resultVisible) {
if (Config.randomTheme !== "off") {
Expand Down