diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-21 02:46:37 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-21 02:46:37 +0900 |
| commit | 483e297f4789fb1fdaa241f87686a00ef55a046d (patch) | |
| tree | f4227c503ce82ffeba84603f872f7237fbee8ea7 /frontend/app/.client/audio/SoundEffect.ts | |
| parent | 0765f61a494de1f284042ba56382983d58d5a6f5 (diff) | |
| parent | 5dba0da3efae63cab5313582a17f20dbb41c6450 (diff) | |
| download | iosdc-japan-2024-albatross-483e297f4789fb1fdaa241f87686a00ef55a046d.tar.gz iosdc-japan-2024-albatross-483e297f4789fb1fdaa241f87686a00ef55a046d.tar.zst iosdc-japan-2024-albatross-483e297f4789fb1fdaa241f87686a00ef55a046d.zip | |
Merge branch 'feat/audio'
Diffstat (limited to 'frontend/app/.client/audio/SoundEffect.ts')
| -rw-r--r-- | frontend/app/.client/audio/SoundEffect.ts | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/frontend/app/.client/audio/SoundEffect.ts b/frontend/app/.client/audio/SoundEffect.ts new file mode 100644 index 0000000..7e40da6 --- /dev/null +++ b/frontend/app/.client/audio/SoundEffect.ts @@ -0,0 +1,47 @@ +export type SoundEffect = + | "finish" + | "winner_1" + | "winner_2" + | "good_1" + | "good_2" + | "good_3" + | "good_4" + | "new_score_1" + | "new_score_2" + | "new_score_3" + | "compile_error_1" + | "compile_error_2"; + +const BASE_URL = + process.env.NODE_ENV === "development" + ? `http://localhost:8002/iosdc-japan/2024/code-battle/files/audio` + : `/iosdc-japan/2024/code-battle/files/audio`; + +export function getFileUrl(soundEffect: SoundEffect): string { + switch (soundEffect) { + case "finish": + return `${BASE_URL}/EX_33.wav`; + case "winner_1": + return `${BASE_URL}/EX_34.wav`; + case "winner_2": + return `${BASE_URL}/EX_35.wav`; + case "good_1": + return `${BASE_URL}/EX_36.wav`; + case "good_2": + return `${BASE_URL}/EX_37.wav`; + case "good_3": + return `${BASE_URL}/EX_38.wav`; + case "good_4": + return `${BASE_URL}/EX_39.wav`; + case "new_score_1": + return `${BASE_URL}/EX_40.wav`; + case "new_score_2": + return `${BASE_URL}/EX_41.wav`; + case "new_score_3": + return `${BASE_URL}/EX_42.wav`; + case "compile_error_1": + return `${BASE_URL}/EX_43.wav`; + case "compile_error_2": + return `${BASE_URL}/EX_44.wav`; + } +} |
