🔊 Diagnostic Sound Alert
A VS Code extension that plays a sound whenever errors or warnings are detected in your code.
- 🔴 error.mp3 — plays when syntax errors or problems are found
- 🟡 warning.mp3 — plays when warnings appear (and no errors are present)
🚀 Installation (Development / F5 Mode)
Step 1 – Prerequisites
Make sure you have the following installed:
Step 2 – Clone / Copy the Extension Folder
Place the diagnostic-sound-alert/ folder anywhere on your machine.
Step 3 – Add Your Sound Files
Put your MP3 files inside assets/sounds/:
assets/sounds/error.mp3
assets/sounds/warning.mp3
⚠️ The filenames must be exactly error.mp3 and warning.mp3.
Step 4 – Open in VS Code
cd diagnostic-sound-alert
code .
Step 5 – Run with F5
- Press F5 (or go to Run → Start Debugging)
- A new Extension Development Host window opens
- Open any file with code — intentionally introduce an error or warning
- 🎵 The sound should play!
🎵 How to Replace Sound Files
- Find your desired
.mp3 sound files
- Rename them:
error.mp3 for errors
warning.mp3 for warnings
- Drop them into
assets/sounds/, replacing the existing files
- Restart the extension (press F5 again, or reload the Extension Host window)
The extension reads the sound files at runtime, so no recompile is needed — just replace and reload.
⚙️ Settings
Open VS Code Settings (Ctrl+,) and search for "Diagnostic Sound Alert":
| Setting |
Default |
Description |
diagnosticSoundAlert.enabled |
true |
Enable/disable all sounds globally |
diagnosticSoundAlert.volume |
0.8 |
Volume: 0.0 (silent) → 1.0 (full) |
diagnosticSoundAlert.showNotifications |
true |
Show status bar messages |
diagnosticSoundAlert.cooldownMs |
2000 |
Min ms between sounds (anti-spam) |
diagnosticSoundAlert.playErrorSound |
true |
Play sound for errors |
diagnosticSoundAlert.playWarningSound |
true |
Play sound for warnings |
Or edit settings.json directly:
{
"diagnosticSoundAlert.enabled": true,
"diagnosticSoundAlert.volume": 0.8,
"diagnosticSoundAlert.showNotifications": true,
"diagnosticSoundAlert.cooldownMs": 2000,
"diagnosticSoundAlert.playErrorSound": true,
"diagnosticSoundAlert.playWarningSound": true
}
🖥️ Commands
Open the Command Palette (Ctrl+Shift+P) and type:
| Command |
Description |
Diagnostic Sound Alert: Toggle On/Off |
Enable or disable the extension |
Diagnostic Sound Alert: Test Error Sound |
Preview the error sound |
Diagnostic Sound Alert: Test Warning Sound |
Preview the warning sound |
You can also click the 🔔 Sound button in the status bar (bottom right) to toggle.
📦 Package as .vsix (for sharing/installing)
# Inside the extension folder
npm install
vsce package
This creates a diagnostic-sound-alert-1.0.0.vsix file.
To install it in VS Code:
code --install-extension diagnostic-sound-alert-1.0.0.vsix
Or via VS Code UI:
Ctrl+Shift+P → Extensions: Install from VSIX...
- Select the
.vsix file
| Platform |
Status |
Method |
| Windows |
✅ Full |
PowerShell + System.Windows.Media.MediaPlayer |
| macOS |
✅ Full |
afplay (built-in) |
| Linux |
✅ Partial |
mpg123 or paplay (must be installed) |
🛠️ Troubleshooting
No sound plays on Windows?
Sound plays but I don't hear it?
- Check that
diagnosticSoundAlert.volume is not 0
- Check Windows volume mixer — VS Code might be muted
Test commands work but real diagnostics don't trigger sound?
- The cooldown (
cooldownMs) may be too long — try lowering it in settings
- Make sure the language extension (e.g., ESLint, Pylance) is publishing diagnostics
📝 License
MIT — free to use, modify, and distribute.