Skip to content

Commit

Permalink
Merge branch 'h12-sfx-webaudio' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
Timtam committed Aug 5, 2024
2 parents 967a274 + 85af25a commit e5ba859
Show file tree
Hide file tree
Showing 25 changed files with 13 additions and 14 deletions.
Binary file removed client/sfx/claim_hit.mp3
Binary file not shown.
Binary file added client/sfx/claim_hit.opus
Binary file not shown.
Binary file removed client/sfx/join_game.mp3
Binary file not shown.
Binary file added client/sfx/join_game.opus
Binary file not shown.
Binary file removed client/sfx/leave_game.mp3
Binary file not shown.
Binary file added client/sfx/leave_game.opus
Binary file not shown.
Binary file removed client/sfx/no_interception.mp3
Binary file not shown.
Binary file added client/sfx/no_interception.opus
Binary file not shown.
Binary file removed client/sfx/pay_token.mp3
Binary file not shown.
Binary file added client/sfx/pay_token.opus
Binary file not shown.
Binary file removed client/sfx/play_hit.mp3
Binary file not shown.
Binary file added client/sfx/play_hit.opus
Binary file not shown.
Binary file removed client/sfx/receive_token.mp3
Binary file not shown.
Binary file added client/sfx/receive_token.opus
Binary file not shown.
Binary file removed client/sfx/stop_hit.mp3
Binary file not shown.
Binary file added client/sfx/stop_hit.opus
Binary file not shown.
Binary file removed client/sfx/you_fail.mp3
Binary file not shown.
Binary file added client/sfx/you_fail.opus
Binary file not shown.
Binary file removed client/sfx/you_lose.mp3
Binary file not shown.
Binary file added client/sfx/you_lose.opus
Binary file not shown.
Binary file removed client/sfx/you_score.mp3
Binary file not shown.
Binary file added client/sfx/you_score.opus
Binary file not shown.
Binary file removed client/sfx/you_win.mp3
Binary file not shown.
Binary file added client/sfx/you_win.opus
Binary file not shown.
27 changes: 13 additions & 14 deletions client/src/sfx-player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,58 +20,57 @@ const getSfx = (sfx: Sfx): Howl => {

switch (sfx) {
case Sfx.noInterception: {
url = new URL("../sfx/no_interception.mp3", import.meta.url).href
url = new URL("../sfx/no_interception.opus", import.meta.url).href
break
}
case Sfx.payToken: {
url = new URL("../sfx/pay_token.mp3", import.meta.url).href
url = new URL("../sfx/pay_token.opus", import.meta.url).href
break
}
case Sfx.playHit: {
url = new URL("../sfx/play_hit.mp3", import.meta.url).href
url = new URL("../sfx/play_hit.opus", import.meta.url).href
break
}
case Sfx.receiveToken: {
url = new URL("../sfx/receive_token.mp3", import.meta.url).href
url = new URL("../sfx/receive_token.opus", import.meta.url).href
break
}
case Sfx.stopHit: {
url = new URL("../sfx/stop_hit.mp3", import.meta.url).href
url = new URL("../sfx/stop_hit.opus", import.meta.url).href
break
}
case Sfx.youFail: {
url = new URL("../sfx/you_fail.mp3", import.meta.url).href
url = new URL("../sfx/you_fail.opus", import.meta.url).href
break
}
case Sfx.youLose: {
url = new URL("../sfx/you_lose.mp3", import.meta.url).href
url = new URL("../sfx/you_lose.opus", import.meta.url).href
break
}
case Sfx.youScore: {
url = new URL("../sfx/you_score.mp3", import.meta.url).href
url = new URL("../sfx/you_score.opus", import.meta.url).href
break
}
case Sfx.youWin: {
url = new URL("../sfx/you_win.mp3", import.meta.url).href
url = new URL("../sfx/you_win.opus", import.meta.url).href
break
}
case Sfx.joinGame: {
url = new URL("../sfx/join_game.mp3", import.meta.url).href
url = new URL("../sfx/join_game.opus", import.meta.url).href
break
}
case Sfx.leaveGame: {
url = new URL("../sfx/leave_game.mp3", import.meta.url).href
url = new URL("../sfx/leave_game.opus", import.meta.url).href
break
}
case Sfx.youClaim: {
url = new URL("../sfx/claim_hit.mp3", import.meta.url).href
url = new URL("../sfx/claim_hit.opus", import.meta.url).href
break
}
}
return new Howl({
src: [url],
format: "audio/mpeg",
html5: true,
format: "opus",
})
}

Expand Down

0 comments on commit e5ba859

Please sign in to comment.