(volume: number)
| 1 | export const playNotificationSound = async (volume: number) => { |
| 2 | try { |
| 3 | const file = 'https://static.main.linendev.com/public/alert.mp3'; |
| 4 | const audio = new Audio(file); |
| 5 | |
| 6 | if (audio) { |
| 7 | audio.volume = volume; |
| 8 | |
| 9 | await audio.play(); |
| 10 | } |
| 11 | } catch (err) { |
| 12 | console.error('Failed to play notification sound:', err); |
| 13 | } |
| 14 | }; |