VS Code Extensions
Error Audio Player

Error Audio Player

by RaghavMakhija

Plays a custom sound when a VS Code terminal command fails, with support for user-selected audio tracks

Downloads

15

Rating

— (0)

Version

0.0.2

Last updated

May 03, 2026

An VS Code extension that plays a custom sound whenever a terminal command fails or produces an error. Never miss an error again!

Features

  • Automatic Error Detection: Monitors terminal output and detects errors, failures, exceptions, and build errors
  • Custom Audio: Choose any audio file (MP3, WAV, OGG, M4A) to play on errors
  • Flexible Configuration: Adjust volume, debounce delays, and toggle the extension on/off
  • Hidden Operation: Runs silently in the background without cluttering your UI
  • Default Fallback: Falls back to a beep sound if no custom audio is configured

Installation

From VS Code Marketplace

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "Error Audio Player"
  4. Click Install

From Source (Development)

git clone https://github.com/your-username/error-audio-player.git
cd error-audio-player
npm install
npm run compile
# Press F5 to open Extension Development Host

Usage

Commands

The extension provides three main commands (accessible via Command Palette Ctrl+Shift+P):

  • Error Audio Player: Pick audio file... - Select a custom audio file to play on errors
  • Error Audio Player: Test play sound - Preview the configured sound
  • Error Audio Player: Toggle enable/disable - Quickly turn the extension on/off

Configuration

Access settings via Preferences > Settings (Ctrl+,) and search for "Error Audio Player":

  • errorAudioPlayer.enable (boolean, default: true)
    Enable or disable the extension globally

  • errorAudioPlayer.audioPath (string, default: empty)
    Full path or URL to your audio file. Supports:

    • Local files: C:\Users\YourName\Music\error.mp3 or /home/user/sounds/error.wav
    • URLs: https://example.com/sound.mp3
    • Leave empty to use bundled beep sound
  • errorAudioPlayer.volume (number, default: 0.8, range: 0.0 - 1.0)
    Playback volume level

  • errorAudioPlayer.playDebounce (number, default: 300 ms)
    Minimum delay between consecutive sound plays to avoid repeated triggers

Example Configuration

Add to your VS Code settings.json:

{
  "errorAudioPlayer.enable": true,
  "errorAudioPlayer.audioPath": "C:\\Users\\YourName\\Music\\error-alert.mp3",
  "errorAudioPlayer.volume": 0.6,
  "errorAudioPlayer.playDebounce": 500
}

Bundled Audio

To include a default audio file with your extension:

  1. Create a media folder in the extension root:
    mkdir media
    
  2. Add your audio file as media/error-sound.mp3 or media/error-sound.wav
  3. The extension will automatically use it if no custom audio is configured

Supported Error Patterns

The extension detects errors using these heuristics:

  • Keywords: error, failed, failure, exception, traceback, fatal, not found, undefined, null
  • Exit codes: Any non-zero exit code (exit 1, exit 127, etc.)
  • Build errors: npm err, compilation failed, build failed, syntax error
  • Test failures: test failed, failing tests, fail:
  • Severity markers: [ERROR], [FAIL], [FATAL], ERROR:, etc.

Extension Settings

This extension contributes the following settings:

  • errorAudioPlayer.enable: Enable/disable playing audio on terminal errors
  • errorAudioPlayer.audioPath: Path or URL to custom audio file
  • errorAudioPlayer.volume: Audio playback volume (0.0 - 1.0)
  • errorAudioPlayer.playDebounce: Minimum milliseconds between consecutive plays

Known Issues

  • Audio playback on WSL terminals may require additional system configuration
  • Some specialized shell output formats may not be detected; open an issue if you find patterns we miss

Publishing to VS Code Marketplace

Prerequisites

  1. Create a Microsoft account at https://aka.ms/SignupMicrosoftAccount
  2. Register as a publisher on https://marketplace.visualstudio.com/manage/publishers
  3. Create a Personal Access Token (PAT) in Azure DevOps

Steps to Publish

  1. Install vsce (VS Code Extension CLI):

    npm install -g @vsce/vsce
    
  2. Update package.json with your publisher:

    {
      "publisher": "your-publisher-name",
      "name": "error-audio-player",
      ...
    }
    
  3. Create CHANGELOG.md (already present)

  4. Create LICENSE file (recommended):

    echo "MIT License - 2024" > LICENSE
    
  5. Package the extension:

    npm run package
    # or manually:
    vsce package
    

    This creates error-audio-player-0.0.1.vsix

  6. Publish to Marketplace:

    vsce publish
    # You'll be prompted for your PAT
    
  7. Or publish manually:

Updating After Publishing

To publish a new version:

  1. Update version in package.json
  2. Add release notes to CHANGELOG.md
  3. Run vsce publish

Release Notes

0.0.1

Initial release with the following features:

  • Terminal error detection
  • Custom audio file selection
  • Volume and debounce configuration
  • Test play sound command
  • Enable/disable toggle command

Contributing

Found a bug or have a feature request? Please open an issue on GitHub!

License

MIT License - See LICENSE file for details

Credits

Built with ❤️ using VS Code Extension API

Following extension guidelines

Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.

Working with Markdown

You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:

  • Split the editor (Cmd+\ on macOS or Ctrl+\ on Windows and Linux).
  • Toggle preview (Shift+Cmd+V on macOS or Shift+Ctrl+V on Windows and Linux).
  • Press Ctrl+Space (Windows, Linux, macOS) to see a list of Markdown snippets.

For more information

Enjoy!

Related extensions