Add browser audio notifications to Moltbot/Clawdbot webchat with 5 intensity levels - from whisper to impossible-to-miss (only when tab is backgrounded).
Browser audio notifications for Moltbot/Clawdbot webchat. Plays a notification sound when new messages arrive - but only when the tab is in the background.
Features
- 🔔 Smart notifications - Only plays when tab is hidden
🎚️ Volume control - Adjustable 0-100%
🎵 5 intensity levels - Whisper (1) to impossible-to-miss (5)
📁 Custom sounds - Upload your own (MP3, WAV, OGG, WebM)
🔕 Easy toggle - Enable/disable with one click
💾 Persistent settings - Preferences saved in localStorage
📱 Mobile-friendly - Graceful degradation on mobile
🚫 Autoplay handling - Respects browser policies
⏱️ Cooldown - Prevents spam (3s between alerts)
🐞 Debug mode - Optional logging
Quick Start
Test the POC
CODEBLOCK0
Test steps:
1. Switch to another tab
Click "Trigger Notification"
Hear the sound! 🔊
Basic Integration
CODEBLOCK1
API
Constructor Options
CODEBLOCK2
Intensity Levels:
- level1 - Whisper (9.5KB) - Most subtle
INLINECODE1 - Soft (12KB) - Gentle
INLINECODE2 - Medium (13KB) - Default
INLINECODE3 - Loud (43KB) - Attention-getting
INLINECODE4 - Very Loud (63KB) - Impossible to miss
Methods
- init() - Initialize (call after Howler loads)
INLINECODE6 - Trigger notification (only if tab hidden)
INLINECODE7 - Play sound immediately (ignore tab state)
INLINECODE8 - Enable/disable notifications
INLINECODE9 - Set volume
INLINECODE10 - Change intensity ('level1' through 'level5')
INLINECODE11 - Get current settings
Browser Compatibility
Browser
Version
Support
Chrome
92+
✅ Full
Firefox
90+ | ✅ Full |
| Safari | 15+ | ✅ Full |
| Mobile | Latest | ⚠️ Limited |