diff --git a/package.json b/package.json index 4f4c254..041b8a5 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "build": "tsc && vite build", "format": "prettier --write .", "test": "vitest", - "test:ui": "vitest --ui" + "test:ui": "vitest --ui", + "sound:generate": "./scripts/generate_sounds.sh" }, "dependencies": { "@emotion/react": "^11.11.4", diff --git a/public/sounds/firework.mp3 b/public/sounds/firework.mp3 new file mode 100644 index 0000000..b6579a0 Binary files /dev/null and b/public/sounds/firework.mp3 differ diff --git a/public/sounds/firework.ogg b/public/sounds/firework.ogg new file mode 100644 index 0000000..c0c11db Binary files /dev/null and b/public/sounds/firework.ogg differ diff --git a/scripts/generate_sounds.sh b/scripts/generate_sounds.sh new file mode 100755 index 0000000..52ce1f0 --- /dev/null +++ b/scripts/generate_sounds.sh @@ -0,0 +1,24 @@ +#!/bin/fish + +cd ./public/sounds + +for f in *.wav + set filename (echo $f | sed 's/\.[^.]*$//') + ffmpeg -n -i "$f" -acodec libvorbis "$filename.ogg" + ffmpeg -n -i "$f" -vn -ar 44100 -ac 2 -b:a 192k "$filename.mp3" + rm $f +end + +for f in *.mp3 + set filename (echo $f | sed 's/\.[^.]*$//') + if ! test -f "$filename.ogg" + ffmpeg -n -i "$f" -acodec libvorbis "$filename.ogg" + end +end + +for f in *.ogg + set filename (echo $f | sed 's/\.[^.]*$//') + if ! test -f "$filename.mp3" + ffmpeg -n -i "$f" -vn -ar 44100 -ac 2 -b:a 192k "$filename.mp3" + end +end diff --git a/src/views/Game/components/GamFinishedDialog.tsx b/src/views/Game/components/GamFinishedDialog.tsx index e5d74b3..e147cc1 100644 --- a/src/views/Game/components/GamFinishedDialog.tsx +++ b/src/views/Game/components/GamFinishedDialog.tsx @@ -71,6 +71,10 @@ const GameFinishedDialog: FunctionComponent = ( min: 0, max: 100, }, + sound: { + enabled: true, + files: ["sounds/firework.mp3"], + }, }} style={{ top: 0,