aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/.client/audio/SoundEffect.ts
blob: fb003fae1f93dd34ee4d5a569ec3108fdc38bd90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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:8003/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`;
	}
}