Skip to content

Commit

Permalink
add fireworks sound
Browse files Browse the repository at this point in the history
  • Loading branch information
naueramant committed Jul 27, 2024
1 parent 458f5bb commit 3131ae3
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Binary file added public/sounds/firework.mp3
Binary file not shown.
Binary file added public/sounds/firework.ogg
Binary file not shown.
24 changes: 24 additions & 0 deletions scripts/generate_sounds.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions src/views/Game/components/GamFinishedDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ const GameFinishedDialog: FunctionComponent<GameFinishedDialogProps> = (
min: 0,
max: 100,
},
sound: {
enabled: true,
files: ["sounds/firework.mp3"],
},
}}
style={{
top: 0,
Expand Down

0 comments on commit 3131ae3

Please sign in to comment.