5.1kโ
by brokemac79
webchat-audio-notifications โ OpenClaw Skill
webchat-audio-notifications is an OpenClaw Skills integration for coding workflows. Add browser audio notifications to Moltbot/Clawdbot webchat with 5 intensity levels - from whisper to impossible-to-miss (only when tab is backgrounded).
Skill Snapshot
| name | webchat-audio-notifications |
| description | Add browser audio notifications to Moltbot/Clawdbot webchat with 5 intensity levels - from whisper to impossible-to-miss (only when tab is backgrounded). OpenClaw Skills integration. |
| owner | brokemac79 |
| repository | brokemac79/webchat-audio-notifications |
| language | Markdown |
| license | MIT |
| topics | |
| security | L1 |
| install | openclaw add @brokemac79/webchat-audio-notifications |
| last updated | Feb 7, 2026 |
Maintainer

brokemac79
Maintains webchat-audio-notifications in the OpenClaw Skills directory.
View GitHub profilename: webchat-audio-notifications description: Add browser audio notifications to Moltbot/Clawdbot webchat with 5 intensity levels - from whisper to impossible-to-miss (only when tab is backgrounded). version: 1.1.0 author: brokemac79 repository: https://github.com/brokemac79/webchat-audio-notifications homepage: https://github.com/brokemac79/webchat-audio-notifications tags:
- webchat
- notifications
- audio
- ux
- browser
- howler
metadata:
clawdbot:
emoji: ๐
compatibility:
minVersion: "2026.1.0"
browsers:
- Chrome 92+
- Firefox 90+
- Safari 15+
- Edge 92+
dependencies:
-
howler.js (included) files:
-
client/howler.min.js
-
client/notification.js
-
client/sounds/notification.mp3
-
client/sounds/alert.mp3 install:
-
kind: manual label: Install webchat audio notifications instructions: |
-
Copy files to your webchat directory:
- client/howler.min.js โ /webchat/js/
- client/notification.js โ /webchat/js/
- client/sounds/ โ /webchat/sounds/
-
Add to your webchat HTML before closing </body>:
<script src="/js/howler.min.js"></script> <script src="/js/notification.js"></script> <script> const notifier = new WebchatNotifications({ soundPath: '/sounds/notification' }); notifier.init(); </script>- Hook into message events:
socket.on('message', () => { if (notifier) notifier.notify(); });- Test by switching tabs and triggering a message
See docs/integration.md for full guide.
-
-
๐ Webchat Audio Notifications
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
cd examples
python3 -m http.server 8080
# Open http://localhost:8080/test.html
Test steps:
- Switch to another tab
- Click "Trigger Notification"
- Hear the sound! ๐
Basic Integration
// Initialize
const notifier = new WebchatNotifications({
soundPath: './sounds',
soundName: 'level3', // Medium intensity (default)
defaultVolume: 0.7
});
await notifier.init();
// Trigger on new message
socket.on('message', () => notifier.notify());
// Use different levels for different events
socket.on('mention', () => {
notifier.setSound('level5'); // Loudest for mentions
notifier.notify();
});
API
Constructor Options
new WebchatNotifications({
soundPath: './sounds', // Path to sounds directory
soundName: 'level3', // level1 (whisper) to level5 (very loud)
defaultVolume: 0.7, // 0.0 to 1.0
cooldownMs: 3000, // Min time between alerts
enableButton: true, // Show enable prompt
debug: false // Console logging
});
Intensity Levels:
level1- Whisper (9.5KB) - Most subtlelevel2- Soft (12KB) - Gentlelevel3- Medium (13KB) - Defaultlevel4- Loud (43KB) - Attention-gettinglevel5- Very Loud (63KB) - Impossible to miss
Methods
init()- Initialize (call after Howler loads)notify(eventType?)- Trigger notification (only if tab hidden)test()- Play sound immediately (ignore tab state)setEnabled(bool)- Enable/disable notificationssetVolume(0-1)- Set volumesetSound(level)- Change intensity ('level1' through 'level5')getSettings()- Get current settings
Browser Compatibility
| Browser | Version | Support |
|---|---|---|
| Chrome | 92+ | โ Full |
| Firefox | 90+ | โ Full |
| Safari | 15+ | โ Full |
| Mobile | Latest | โ ๏ธ Limited |
Overall: 92% of users (Web Audio API support)
File Structure
webchat-audio-notifications/
โโโ client/
โ โโโ notification.js # Main class (10KB)
โ โโโ howler.min.js # Audio library (36KB)
โ โโโ sounds/
โ โโโ level1.mp3 # Whisper (9.5KB)
โ โโโ level2.mp3 # Soft (12KB)
โ โโโ level3.mp3 # Medium (13KB, default)
โ โโโ level4.mp3 # Loud (43KB)
โ โโโ level5.mp3 # Very Loud (63KB)
โโโ examples/
โ โโโ test.html # Standalone test with all levels
โโโ docs/
โ โโโ integration.md # Integration guide
โโโ README.md # Full documentation
Integration Guide
See docs/integration.md for:
- Step-by-step setup
- Moltbot-specific hooks
- React/Vue examples
- Common patterns (@mentions, DND, badges)
- Testing checklist
Configuration Examples
Simple
const notifier = new WebchatNotifications();
await notifier.init();
notifier.notify();
Advanced
const notifier = new WebchatNotifications({
soundPath: '/assets/sounds',
soundName: 'level2', // Start with soft
defaultVolume: 0.8,
cooldownMs: 5000,
debug: true
});
await notifier.init();
// Regular messages = soft
socket.on('message', () => {
notifier.setSound('level2');
notifier.notify();
});
// Mentions = very loud
socket.on('mention', () => {
notifier.setSound('level5');
notifier.notify();
});
// DMs = loud
socket.on('dm', () => {
notifier.setSound('level4');
notifier.notify();
});
With UI Controls
<input type="range" min="0" max="100"
onchange="notifier.setVolume(this.value / 100)">
<button onclick="notifier.test()">Test ๐</button>
Troubleshooting
No sound?
- Click page first (autoplay restriction)
- Check tab is actually hidden
- Verify volume > 0
- Check console for errors
Sound plays when tab active?
- Enable debug mode
- Check for "Tab is visible, skipping" message
- Report as bug if missing
Mobile not working?
- iOS requires user gesture per play
- Consider visual fallback (flashing favicon)
Performance
- Bundle: ~122KB total (minified)
- Memory: ~2MB during playback
- CPU: Negligible (browser-native)
- Network: One-time download, cached
Security
- โ No external requests
- โ localStorage only
- โ No tracking
- โ No special permissions
License
MIT License
Credits
- Audio library: Howler.js (MIT)
- Sounds: Mixkit.co (Royalty-free)
- Author: @brokemac79
- For: Moltbot/Clawdbot community
Contributing
- Test with
examples/test.html - Enable debug mode
- Report issues with browser + console output
Roadmap
- WebM format (smaller files)
- Per-event sounds (mention, DM, etc.)
- Visual fallback (favicon flash)
- System notifications API
- Settings UI component
- Do Not Disturb mode
Status: โ
v1.1.0 Complete - 5 Intensity Levels
Tested: Chrome, Firefox, Safari
Ready for: Production use & ClawdHub publishing
Links
- ๐ README - Full documentation
- ๐ง Integration Guide - Setup instructions
- ๐งช Test Page - Try it yourself
- ๐ฌ Discord Thread - Community discussion
๐ Webchat Audio Notifications
Browser audio notifications for Moltbot/Clawdbot webchat. Get notified when new messages arrive - but only when the tab is in the background.
๐งช Try the live demo - Download and open in your browser!
Status: โ v1.2.0 - Production ready, looking for testers!
๐ Quick Test (2 minutes)
Want to try it right now?
- Clone or download this repo
- Open
examples/test.htmlin your browser - Click the green "๐ Test Sound" button (unlocks audio)
- Hear the notification sound!
- Try different intensity levels (Level 1-5 dropdown)
That's it! If you hear sounds, it works. ๐
โ ๏ธ Important: Browser Autoplay Policy
Why you must click "Test Sound" first:
All modern browsers (Chrome, Firefox, Safari, Edge) block audio autoplay by default as a security feature. This prevents websites from playing sounds without your permission.
This is NORMAL and EXPECTED behavior, not a bug!
What happens:
- Page loads โ Audio is blocked ๐
- You click "Test Sound" (or any button) โ Audio unlocks ๐
- From now on, notifications work automatically โ
You only need to click once per session. After that, all sounds play normally. This is how all web audio works - YouTube, Spotify, etc. all require a click first.
If you don't click first and don't hear sounds, that's why! Just click the Test Sound button.
โจ Features
- ๐ Smart notifications - Only plays sound when tab is hidden
- ๐๏ธ Volume control - Adjustable notification volume (0-100%)
- ๐ Easy toggle - Enable/disable with one click
- ๐ต 5 intensity levels - From whisper (level 1) to impossible-to-miss (level 5)
- ๐ Custom sounds - Upload your own notification sounds (MP3, WAV, OGG, WebM)
- ๐พ Persistent preferences - Settings saved in localStorage
- ๐ฑ Mobile-friendly - Graceful handling of mobile restrictions
- ๐ซ Autoplay handling - Respects browser autoplay policies
- โฑ๏ธ Cooldown - Prevents notification spam (3s between alerts)
- ๐ Debug mode - Optional logging for troubleshooting
๐ฏ Quick Start
Three Easy Setup Options
Want easy configuration? โ Easy Setup Guide
- Drop-in Settings Panel - Ready-made UI (recommended)
- JSON Configuration - Config file approach
- Programmatic - Full control via code
1. Test the POC
Open examples/test.html or examples/easy-setup.html in your browser:
cd webchat-audio-notifications/examples
python3 -m http.server 8080
# Open http://localhost:8080/test.html
Test steps:
- Click "Enable Notifications" if prompted
- Switch to another tab
- Click "Trigger Notification" (or have someone trigger it)
- You should hear a sound! ๐
2. Basic Integration
Simplest (with settings UI):
<!-- Load libraries -->
<script src="./howler.min.js"></script>
<script src="./notification.js"></script>
<script>
let notifier = null;
window.addEventListener('DOMContentLoaded', async () => {
notifier = new WebchatNotifications({
soundPath: './sounds',
soundName: 'level3'
});
await notifier.init();
});
</script>
<!-- Add settings panel (users can configure themselves) -->
<div id="notification-settings"></div>
<script>
fetch('./settings-panel.html')
.then(r => r.text())
.then(html => {
document.getElementById('notification-settings').innerHTML = html;
});
</script>
Programmatic (full control):
<script src="./howler.min.js"></script>
<script src="./notification.js"></script>
<script>
const notifier = new WebchatNotifications({
soundPath: './sounds',
soundName: 'level3',
defaultVolume: 0.7
});
await notifier.init();
// Trigger notification when new message arrives
socket.on('message', (msg) => {
notifier.notify();
});
</script>
๐ Full Easy Setup Guide - Settings panel, JSON config, and more!
๐ API Documentation
Constructor
const notifier = new WebchatNotifications(options);
Options:
{
soundPath: './sounds', // Path to sounds directory
soundName: 'level3', // Intensity: 'level1' through 'level5'
defaultVolume: 0.7, // Volume level (0.0 to 1.0)
cooldownMs: 3000, // Min time between notifications (ms)
enableButton: true, // Show enable prompt if autoplay blocked
debug: false // Enable console logging
}
Sound Intensity Levels:
level1- Whisper (9.5KB) - Most subtlelevel2- Soft (12KB) - Gentle chimelevel3- Medium (13KB) - Default, balancedlevel4- Loud (43KB) - Attention-gettinglevel5- Very Loud (63KB) - Impossible to miss
Methods
init()
Initialize the notification system. Must be called after Howler.js loads.
await notifier.init();
notify(eventType?)
Trigger a notification (only plays if tab is hidden).
notifier.notify(); // Default notification
notifier.notify('message'); // Message notification (future: different sounds)
test()
Play notification sound immediately (ignores tab state, useful for testing).
notifier.test();
setEnabled(enabled)
Enable or disable notifications.
notifier.setEnabled(true); // Enable
notifier.setEnabled(false); // Disable
setVolume(volume)
Set notification volume (0.0 to 1.0).
notifier.setVolume(0.5); // 50% volume
notifier.setVolume(1.0); // 100% volume
setSound(soundName)
Change notification intensity level.
notifier.setSound('level1'); // Whisper (most subtle)
notifier.setSound('level2'); // Soft
notifier.setSound('level3'); // Medium (default)
notifier.setSound('level4'); // Loud
notifier.setSound('level5'); // Very loud (impossible to miss)
notifier.setSound('custom'); // Use uploaded custom sound
uploadCustomSound(file)
Upload a custom notification sound.
const fileInput = document.getElementById('file-input');
const file = fileInput.files[0];
const success = await notifier.uploadCustomSound(file);
if (success) {
notifier.setSound('custom'); // Switch to custom sound
}
Supported formats: MP3, WAV, OGG, WebM
Max file size: 500KB
Storage: Browser localStorage (no server upload)
removeCustomSound()
Remove the uploaded custom sound.
notifier.removeCustomSound();
getCustomSound()
Get info about the uploaded custom sound.
const custom = notifier.getCustomSound();
if (custom) {
console.log('Custom sound:', custom.name);
}
// Returns: { name, dataUrl } or null
getSettings()
Get current settings.
const settings = notifier.getSettings();
// Returns: { enabled, volume, soundName, isMobile, initialized }
๐ Browser Compatibility
| Browser | Version | Support | Notes |
|---|---|---|---|
| Chrome | 92+ | โ Full | Strictest autoplay policy |
| Firefox | 90+ | โ Full | Slightly more permissive |
| Safari | 15+ | โ Full | Requires WebKit prefixes (handled) |
| Edge | 92+ | โ Full | Chromium-based |
| Mobile Chrome | Latest | โ ๏ธ Limited | Requires user gesture per play |
| Mobile Safari | Latest | โ ๏ธ Limited | iOS restrictions apply |
Overall compatibility: 92% of users (based on Web Audio API support)
โ๏ธ Configuration Examples
Simple Setup
const notifier = new WebchatNotifications({
soundPath: './sounds',
soundName: 'level3' // Medium intensity (default)
});
await notifier.init();
notifier.notify(); // That's it!
Advanced Setup
const notifier = new WebchatNotifications({
soundPath: '/assets/sounds',
soundName: 'level3', // Start with medium
defaultVolume: 0.8,
cooldownMs: 5000, // 5 second cooldown
debug: true // Enable logging
});
await notifier.init();
// Hook into your message system
chatClient.on('newMessage', () => notifier.notify());
chatClient.on('mention', () => {
notifier.setSound('level5'); // Use loudest for mentions
notifier.notify();
});
With User Controls
<!-- Volume slider -->
<input type="range" min="0" max="100" value="70"
onchange="notifier.setVolume(this.value / 100)">
<!-- Sound intensity selector -->
<select onchange="notifier.setSound(this.value)">
<option value="level1">๐ Level 1 - Whisper</option>
<option value="level2">๐ Level 2 - Soft</option>
<option value="level3" selected>๐ Level 3 - Medium</option>
<option value="level4">๐ Level 4 - Loud</option>
<option value="level5">๐ข Level 5 - Very Loud</option>
</select>
<!-- Enable/disable toggle -->
<button onclick="notifier.setEnabled(true)">Enable ๐</button>
<button onclick="notifier.setEnabled(false)">Disable ๐</button>
<!-- Test button -->
<button onclick="notifier.test()">Test Sound ๐</button>
<!-- Custom sound upload -->
<input type="file" id="custom-sound" accept="audio/*" onchange="uploadCustom(this)">
<script>
async function uploadCustom(input) {
const file = input.files[0];
if (await notifier.uploadCustomSound(file)) {
notifier.setSound('custom');
alert('Custom sound uploaded!');
}
}
</script>
Custom Sound Upload Example
Users can upload their own notification sounds:
<input type="file" id="sound-upload" accept="audio/mpeg,audio/wav,audio/ogg,audio/webm">
<script>
document.getElementById('sound-upload').addEventListener('change', async (e) => {
const file = e.target.files[0];
if (!file) return;
// Upload the sound
const success = await notifier.uploadCustomSound(file);
if (success) {
// Automatically switch to custom sound
notifier.setSound('custom');
console.log('Custom sound uploaded:', file.name);
// Test it
notifier.test();
} else {
console.error('Upload failed - check file type and size');
}
});
// Check if custom sound exists
const customSound = notifier.getCustomSound();
if (customSound) {
console.log('Custom sound available:', customSound.name);
}
</script>
Limitations:
- Max file size: 500KB
- Supported formats: MP3, WAV, OGG, WebM
- Stored in browser localStorage (no server upload)
- Clearing browser data removes custom sound
๐จ Troubleshooting
No sound playing?
1. Check browser autoplay policy:
- Click anywhere on the page first (browser may require user interaction)
- Look for the enable notification prompt
- Check browser console for errors
2. Verify tab is hidden:
- Notifications only play when tab is in background
- Use
notifier.test()to test regardless of tab state
3. Check volume:
console.log(notifier.getSettings().volume); // Should be > 0
notifier.setVolume(1.0); // Try max volume
4. Verify files are accessible:
- Open browser console
- Check Network tab for 404 errors on sound files
- Ensure sound files are in the correct path
Sound plays when tab is active?
This shouldn't happen - it's a bug! The document.hidden check should prevent this.
Debug steps:
- Enable debug mode:
new WebchatNotifications({ debug: true }) - Check console for "Tab is visible, skipping notification" message
- If not appearing, there may be a Page Visibility API issue
Mobile not working?
iOS Safari and mobile browsers have strict audio restrictions:
- Requires user gesture for EACH audio play (not just once)
- Background tab audio may be blocked entirely
- Consider using visual notifications (flashing favicon) on mobile
Detect mobile:
const settings = notifier.getSettings();
if (settings.isMobile) {
console.log('Mobile detected - audio may be limited');
}
๐ฆ File Structure
webchat-audio-notifications/
โโโ client/
โ โโโ notification.js # Main notification class (10KB)
โ โโโ howler.min.js # Howler.js library (36KB)
โ โโโ settings-panel.html # Drop-in settings UI (8KB)
โ โโโ config-loader.js # JSON config helper (2KB)
โ โโโ config.example.json # Example configuration
โ โโโ sounds/
โ โโโ level1.mp3 # Level 1 - Whisper (9.5KB)
โ โโโ level2.mp3 # Level 2 - Soft (12KB)
โ โโโ level3.mp3 # Level 3 - Medium (13KB, default)
โ โโโ level4.mp3 # Level 4 - Loud (43KB)
โ โโโ level5.mp3 # Level 5 - Very Loud (63KB)
โ โโโ notification.mp3 # Legacy (same as level3)
โ โโโ alert.mp3 # Legacy (same as level5)
โ โโโ SOUNDS.md # Sound attribution & guide
โโโ examples/
โ โโโ test.html # Full test page with all features
โ โโโ easy-setup.html # Simple demo with settings panel
โโโ docs/
โ โโโ EASY_SETUP.md # Easy setup guide (settings panel, JSON, etc.)
โ โโโ integration.md # Advanced integration guide
โโโ README.md # This file
โโโ SKILL.md # ClawdHub metadata
๐ Privacy & Security
- No external requests - All assets loaded locally
- localStorage only - Preferences stored in user's browser
- No tracking - Zero analytics or telemetry
- No permissions required - Works with standard Web Audio API
๐ License
MIT License - see LICENSE file for details.
๐ Credits
- Audio library: Howler.js by James Simpson (MIT License)
- Sound files: Mixkit.co (Royalty-free, commercial use allowed)
- Created for: Moltbot/Clawdbot community
๐ค Contributing
Found a bug? Have a feature request?
- Test with
examples/test.htmlfirst - Enable debug mode to see console logs
- Open an issue with browser version and console output
๐ Next Steps
- Multiple intensity levels (5 levels implemented)
- WebM sound format support (smaller files)
- Visual notification fallback (flashing favicon)
- System notifications API integration
- Settings UI component
- Do Not Disturb mode (time-based)
- Custom sound upload support
๐ก Usage Tips
Choosing Your Level:
- Open office? Use level 1-2 (subtle, won't disturb neighbors)
- Home office? Use level 3 (balanced default)
- Noisy environment? Use level 4-5 (cuts through background noise)
- Critical alerts only? Use level 5 for important notifications
Dynamic Switching:
// Soft for regular messages
notifier.setSound('level2');
// Loud for mentions
socket.on('mention', () => {
notifier.setSound('level5');
notifier.notify();
setTimeout(() => notifier.setSound('level2'), 1000);
});
Status: โ
POC v1.1.0 - 5 intensity levels
Last updated: 2026-01-28
Maintained by: @brokemac79
Permissions & Security
Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.
- โ No external requests - โ localStorage only - โ No tracking - โ No special permissions
Requirements
- OpenClaw CLI installed and configured.
- Language: Markdown
- License: MIT
- Topics:
Configuration
### Simple ```javascript const notifier = new WebchatNotifications(); await notifier.init(); notifier.notify(); ``` ### Advanced ```javascript const notifier = new WebchatNotifications({ soundPath: '/assets/sounds', soundName: 'level2', // Start with soft defaultVolume: 0.8, cooldownMs: 5000, debug: true }); await notifier.init(); // Regular messages = soft socket.on('message', () => { notifier.setSound('level2'); notifier.notify(); }); // Mentions = very loud socket.on('mention', () => { notifier.setSound('level5'); notifier.notify(); }); // DMs = loud socket.on('dm', () => { notifier.setSound('level4'); notifier.notify(); }); ``` ### With UI Controls ```html <input type="range" min="0" max="100" onchange="notifier.setVolume(this.value / 100)"> <button onclick="notifier.test()">Test ๐</button> ```
FAQ
How do I install webchat-audio-notifications?
Run openclaw add @brokemac79/webchat-audio-notifications in your terminal. This installs webchat-audio-notifications into your OpenClaw Skills catalog.
Does this skill run locally or in the cloud?
OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.
Where can I verify the source code?
The source repository is available at https://github.com/openclaw/skills/tree/main/skills/brokemac79/webchat-audio-notifications. Review commits and README documentation before installing.
