Added sound effects to the exam generation

This commit is contained in:
Tiago Ribeiro
2023-11-29 20:26:48 +00:00
parent 1f0e5f4a08
commit a3864eb7d3
6 changed files with 28 additions and 7 deletions

View File

@@ -1,8 +1,9 @@
import {Howl, Howler} from "howler";
export const checkSound = () => {
export type Sound = "check" | "sent";
export const playSound = (path: Sound) => {
const sound = new Howl({
src: ["audio/check.mp3"],
src: [`audio/${path}.mp3`],
});
sound.play();