Audio-alerts
Configurable sound triggers for VS Code development events.
Features
- Built-in event sounds:
Syntax Error
Build Failed
Runtime Error
Test Failed
Line Too Long
Line Increased
- Terminal failure classification (syntax/test/build/runtime) based on command + output patterns.
- Per-event enable/disable.
- Global controls:
- Master switch
- Global volume
- Global cooldown
- Assign sounds from:
- Local audio files (
.mp3, .wav, .ogg, .m4a)
- Myinstants search + fetch (downloaded to local extension storage automatically)
- Preview assigned sounds.
- Import/export JSON config.
- Custom events:
- Create
- Rename
- Toggle
- Upload/Preview/Clear
- Delete
Requirements
- VS Code
^1.88.0
- Node.js + npm
Setup
- Install dependencies:
npm install
- Build extension:
npm run build
- Open this folder in VS Code.
- Press
F5 to launch Extension Development Host.
Open The Panel
- Run command:
Open Sound Manager
- Command ID:
soundExtension.openPanel
How To Use
1. Assign Sound For Built-in Events
For each built-in event card:
Upload: choose local audio file.
Fetch: search Myinstants by term, pick a result, and it is downloaded + assigned.
Preview: play assigned sound.
Clear: remove assigned sound.
2. Custom Events
In the Custom Events section:
- Enter event name.
- Click
Create Event.
- Upload a sound and preview it.
- Rename/toggle/delete as needed.
Custom events are connected to real triggers. You can choose one trigger per custom event from:
Syntax Error
Build Failed
Runtime Error
Test Failed
Line Too Long
Line Increased
Custom Event Example
Example: create a custom event called Deploy Success.
- In
Custom Events, enter Deploy Success.
- Select trigger (for example
Build Failed).
- Click
Create Event.
- Click
Upload and choose a file like deploy-success.mp3.
- Click
Preview to verify audio.
- Keep toggle enabled.
- Click
Save Changes.
Exported config will include an item like:
{
"customEvents": [
{
"id": "custom-1700000000000-ab12cd",
"name": "Deploy Success",
"trigger": "buildFailed",
"enabled": true,
"sound": "/home/you/.config/Code/User/globalStorage/local.sound-extension/downloaded-sounds/deploy-success.mp3"
}
]
}
3. Cooldown
- Cooldown unit is milliseconds.
- Example:
2000 = 2 seconds.
- During cooldown, repeated triggers are ignored.
4. Save / Import / Export
Save Changes: persists current state.
Export: writes JSON config.
Import: loads JSON config.
Reset to Defaults: clears sounds and resets toggles/settings.
Trigger Behavior
Editor/Diagnostics
- New diagnostics with severity
Error (active document): Syntax Error.
- Any line exceeding configured max length:
Line Too Long.
- On save, if line count increases:
Line Increased.
Terminal
On non-zero exit code, output is classified to:
Syntax Error if syntax/parse patterns match.
Test Failed if test command or failure patterns match.
Build Failed if build command or build error patterns match.
Runtime Error fallback for other failures.
Audio Playback Notes
- Local file sources are played through:
- Webview audio
- Plus system player fallback (
afplay / paplay / aplay / ffplay / PowerShell)
- URL sources are treated as valid, but Myinstants fetch flow downloads to local files for reliability.
Project Scripts
npm run build - compile TypeScript to out/
npm run watch - watch mode build
npm run lint - placeholder (no lint rules configured)
Files
- Extension entry:
src/extension.ts
- Event engine:
src/event-engine.ts
- Terminal watcher:
src/terminal-watcher.ts
- Sound manager/state:
src/sound-manager.ts, src/state.ts
- Webview UI:
src/webview/*
Troubleshooting
- No sound plays:
- Ensure master switch is enabled.
- Ensure event toggle is enabled.
- Ensure sound source is assigned.
- Check cooldown is not too high.
- Try
Preview first.
- Myinstants fetch returns nothing:
- Verify internet access.
- Try a different search term.
- Myinstants HTML structure may have changed.
- After code changes, old UI behavior persists:
- Rebuild with
npm run build.
- Reload VS Code window / restart extension host.
| |