-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfalcon-sounds.lib
More file actions
73 lines (61 loc) · 3.12 KB
/
falcon-sounds.lib
File metadata and controls
73 lines (61 loc) · 3.12 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!-- FALCON SOUNDS LIBRARY v2.2 -->
<!--
Usage:
- playNotificationSound(notificationType): Plays sound matching the argument for notificationType (alert, email, remove, success) from USER_SETTINGS
-->
<!-- JAVASCRIPT FUNCTIONS -->
<script type="text/javascript">
const soundLibrary = {
// Alert
alert01: new Audio('https://meesterzee.github.io/FalconEDU/audio/alert_error-01.wav'),
alert02: new Audio('https://meesterzee.github.io/FalconEDU/audio/alert_error-02.wav'),
alert03: new Audio('https://meesterzee.github.io/FalconEDU/audio/alert_error-03.wav'),
alert04: new Audio('https://meesterzee.github.io/FalconEDU/audio/icq-message.wav'),
alert05: new Audio('https://meesterzee.github.io/FalconEDU/audio/alert_mario.wav'),
// Email
email01: new Audio('https://meesterzee.github.io/FalconEDU/audio/hero_simple-celebration-01.wav'),
email02: new Audio('https://meesterzee.github.io/FalconEDU/audio/hero_simple-celebration-02.wav'),
email03: new Audio('https://meesterzee.github.io/FalconEDU/audio/hero_simple-celebration-03.wav'),
email04: new Audio('https://meesterzee.github.io/FalconEDU/audio/hero_decorative-celebration-01.wav'),
email05: new Audio('https://meesterzee.github.io/FalconEDU/audio/hero_decorative-celebration-02.wav'),
email06: new Audio('https://meesterzee.github.io/FalconEDU/audio/hero_mario.wav'),
// Remove/delete
remove01: new Audio('https://meesterzee.github.io/FalconEDU/audio/remove_trash.mp3'),
remove02: new Audio('https://meesterzee.github.io/FalconEDU/audio/remove_crunch.mp3'),
remove03: new Audio('https://meesterzee.github.io/FalconEDU/audio/remove_potato-chip.mp3'),
remove04: new Audio('https://meesterzee.github.io/FalconEDU/audio/remove_mario.wav'),
// Notification
success01: new Audio('https://meesterzee.github.io/FalconEDU/audio/notification_simple-01.wav'),
success02: new Audio('https://meesterzee.github.io/FalconEDU/audio/notification_simple-02.wav'),
success03: new Audio('https://meesterzee.github.io/FalconEDU/audio/notification_decorative-01.wav'),
success04: new Audio('https://meesterzee.github.io/FalconEDU/audio/notification_high-intensity.wav'),
success05: new Audio('https://meesterzee.github.io/FalconEDU/audio/notification_ambient.wav'),
success06: new Audio('https://meesterzee.github.io/FalconEDU/audio/notification_mario.wav')
};
// Preload the sounds
for (const sound in soundLibrary) {
soundLibrary[sound].load();
}
function playNotificationSound(notificationType) {
const silentModeSetting = USER_SETTINGS.silentMode;
if (silentModeSetting !== 'true') {
let sound;
switch (notificationType) {
case "alert":
sound = USER_SETTINGS.alertSound;
break;
case "email":
sound = USER_SETTINGS.emailSound;
break;
case "remove":
sound = USER_SETTINGS.removeSound;
break;
case "success":
sound = USER_SETTINGS.successSound;
break;
}
soundLibrary[sound].currentTime = 0; // Reset to start
soundLibrary[sound].play();
}
}
</script>