-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfalcon-sounds.lib
More file actions
60 lines (50 loc) · 2.38 KB
/
falcon-sounds.lib
File metadata and controls
60 lines (50 loc) · 2.38 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
<!-- 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'),
// Sync
sync01: new Audio('https://meesterzee.github.io/FalconEDU/audio/hero_simple-celebration-01.wav'),
sync02: new Audio('https://meesterzee.github.io/FalconEDU/audio/hero_simple-celebration-02.wav'),
sync03: new Audio('https://meesterzee.github.io/FalconEDU/audio/hero_simple-celebration-03.wav'),
sync04: new Audio('https://meesterzee.github.io/FalconEDU/audio/hero_decorative-celebration-01.wav'),
sync05: new Audio('https://meesterzee.github.io/FalconEDU/audio/hero_decorative-celebration-02.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')
};
// 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 "sync":
sound = USER_SETTINGS.syncSound;
break;
case "success":
sound = USER_SETTINGS.successSound;
break;
}
soundLibrary[sound].currentTime = 0; // Reset to start
soundLibrary[sound].play();
}
}
</script>