forked from abner/for-legacy-web
Port sync, queue management and notifs.
This commit is contained in:
21
src/assets/sounds/Audio.ts
Normal file
21
src/assets/sounds/Audio.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import message from './message.mp3';
|
||||
import call_join from './call_join.mp3';
|
||||
import call_leave from './call_leave.mp3';
|
||||
|
||||
const SoundMap: { [key in Sounds]: string } = {
|
||||
message,
|
||||
call_join,
|
||||
call_leave
|
||||
}
|
||||
|
||||
export type Sounds = 'message' | 'call_join' | 'call_leave';
|
||||
|
||||
export function playSound(sound: Sounds) {
|
||||
let file = SoundMap[sound];
|
||||
let el = new Audio(file);
|
||||
try {
|
||||
el.play();
|
||||
} catch (err) {
|
||||
console.error('Failed to play audio file', file, err);
|
||||
}
|
||||
}
|
||||
BIN
src/assets/sounds/call_join.mp3
Normal file
BIN
src/assets/sounds/call_join.mp3
Normal file
Binary file not shown.
BIN
src/assets/sounds/call_join.ogg
Normal file
BIN
src/assets/sounds/call_join.ogg
Normal file
Binary file not shown.
BIN
src/assets/sounds/call_leave.mp3
Normal file
BIN
src/assets/sounds/call_leave.mp3
Normal file
Binary file not shown.
BIN
src/assets/sounds/call_leave.ogg
Normal file
BIN
src/assets/sounds/call_leave.ogg
Normal file
Binary file not shown.
BIN
src/assets/sounds/inbound.mp3
Normal file
BIN
src/assets/sounds/inbound.mp3
Normal file
Binary file not shown.
BIN
src/assets/sounds/inbound.ogg
Normal file
BIN
src/assets/sounds/inbound.ogg
Normal file
Binary file not shown.
BIN
src/assets/sounds/message.mp3
Normal file
BIN
src/assets/sounds/message.mp3
Normal file
Binary file not shown.
BIN
src/assets/sounds/message.ogg
Normal file
BIN
src/assets/sounds/message.ogg
Normal file
Binary file not shown.
BIN
src/assets/sounds/outbound.mp3
Normal file
BIN
src/assets/sounds/outbound.mp3
Normal file
Binary file not shown.
BIN
src/assets/sounds/outbound.ogg
Normal file
BIN
src/assets/sounds/outbound.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user