Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Error Sound Notifier - KannadaNew to Visual Studio Code? Get it now.
Error Sound Notifier - Kannada

Error Sound Notifier - Kannada

Santosh-0011

|
13 installs
| (0) | Free
Plays sounds when errors appear or are fixed on file save
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Author & Contact

Santoshkumar Patil
Contact: 9036664017
Email: santoshpatil7968@gmail.com

Error Sound Notifier

A VS Code extension that plays sound notifications when errors appear or are fixed in your code.

Features

  • 🔊 Plays a sound when an error is detected in the active file
  • ✅ Plays a success sound when all errors are fixed
  • 🎯 Tracks error state per file to avoid repeated triggers
  • 🚀 Works with any language that provides diagnostics in VS Code

How It Works

The extension listens for diagnostics changes using vscode.languages.onDidChangeDiagnostics and:

  1. Monitors only the active editor file
  2. Detects when errors appear (transition from no errors to errors)
  3. Detects when errors are fixed (transition from errors to no errors)
  4. Prevents duplicate sound triggers by tracking previous error state

Installation & Setup

Prerequisites

  • Node.js (v18 or higher)
  • VS Code (v1.75.0 or higher)
  • npm or yarn

Step 1: Install Dependencies

cd error-sound-notifier
npm install

Step 2: Add Sound Files

Create a sounds folder in the extension root and add two MP3 files:

error-sound-notifier/
├── sounds/
│   ├── error.mp3
│   └── success.mp3
├── src/
├── package.json
└── ...

Where to get sound files:

  • Create your own or download from free sound libraries like:
    • Freesound.org
    • Zapsplat
    • Mixkit
  • Keep files short (1-2 seconds) for best experience
  • Ensure files are in MP3 format

Step 3: Compile the Extension

npm run compile

This compiles TypeScript to JavaScript in the out folder.

Running the Extension

Method 1: Debug/Test in Extension Development Host

  1. Open the error-sound-notifier folder in VS Code
  2. Press F5 or go to Run > Start Debugging
  3. A new VS Code window will open with the extension loaded
  4. Open any file with errors (or create some errors) to test
  5. Fix the errors to hear the success sound

Method 2: Install Locally

  1. Package the extension:

    npm install -g @vscode/vsce
    npm run package
    

    This creates a .vsix file (e.g., error-sound-notifier-1.0.0.vsix)

  2. Install the extension:

    • Open VS Code
    • Go to Extensions view (Ctrl+Shift+X)
    • Click the ... menu → Install from VSIX
    • Select the generated .vsix file
  3. Reload VS Code to activate the extension

Usage

Once installed and running:

  1. Open any code file in VS Code
  2. Introduce an error (e.g., syntax error, type error)
    • 🔊 The error sound will play
  3. Fix the error and save the file
    • ✅ The success sound will play

Example Test Cases

JavaScript/TypeScript:

// Introduce error (missing semicolon or undefined variable)
let x = undefinedVariable

// Fix it
let x = 5;

Python:

# Introduce error (syntax)
def hello(
    print("hello")

# Fix it
def hello():
    print("hello")

Testing Sounds on Different Platforms

Windows

The extension uses PowerShell's Media.SoundPlayer (built-in, no dependencies required)

macOS

Uses afplay command (built-in)

Linux

Tries these commands in order:

  • paplay (PulseAudio)
  • aplay (ALSA)
  • ffplay (FFmpeg)

Install if needed:

# Ubuntu/Debian
sudo apt-get install pulseaudio-utils alsa-utils

# Fedora
sudo dnf install alsa-utils pulseaudio-utils

Project Structure

error-sound-notifier/
├── src/
│   └── extension.ts          # Main extension logic
├── sounds/
│   ├── error.mp3             # Sound for errors (add this)
│   └── success.mp3           # Sound for success (add this)
├── out/                      # Compiled JavaScript (generated)
├── node_modules/             # Dependencies (generated)
├── package.json              # Extension manifest
├── tsconfig.json             # TypeScript configuration
├── .vscodeignore             # Files to exclude from package
└── README.md                 # This file

Configuration

Customizing Publisher Name

Before publishing, update the publisher field in package.json:

{
  "publisher": "your-username"
}

You can register as a publisher at Visual Studio Marketplace.

Customizing Sound Files

Replace sounds/error.mp3 and sounds/success.mp3 with your preferred sounds.

Development

Watch Mode

For active development with auto-compilation:

npm run watch

Debugging

  1. Set breakpoints in src/extension.ts
  2. Press F5 to start debugging
  3. Check the Debug Console for logs

Packaging for Distribution

Create VSIX Package

npm run package

This creates error-sound-notifier-1.0.0.vsix

Publish to VS Code Marketplace

  1. Create a publisher account at https://marketplace.visualstudio.com/manage
  2. Get a Personal Access Token from Azure DevOps
  3. Login to vsce:
    vsce login your-publisher-name
    
  4. Publish:
    vsce publish
    

Troubleshooting

Sounds Not Playing

  1. Check sound files exist:

    • Verify sounds/error.mp3 and sounds/success.mp3 are present
    • Check the VS Code Output panel → "Error Sound Notifier" for warnings
  2. Check platform audio:

    • Windows: Ensure system sounds work
    • macOS: Test with afplay /System/Library/Sounds/Ping.aiff
    • Linux: Install audio players (see above)
  3. Check extension is active:

    • Open Command Palette (Ctrl+Shift+P)
    • Type "Developer: Show Running Extensions"
    • Look for "Error Sound Notifier"

Sounds Playing Too Often

The extension tracks error state to prevent repeated triggers. If you're hearing repeated sounds:

  • Ensure you're testing in the active editor only
  • Check that errors are truly transitioning (not just refreshing)

Extension Not Activating

  1. Check package.json has correct activationEvents
  2. Run Developer: Reload Window from Command Palette
  3. Check for errors in Developer Tools (Help > Toggle Developer Tools)

Technical Details

Key Features

  • Uses vscode.languages.onDidChangeDiagnostics API
  • Tracks error state per document URI to detect transitions
  • Only monitors the active editor to avoid noise
  • Prevents overlapping sound playback
  • Cross-platform sound playback support

Error Detection Logic

// State transitions:
No errors → Has errors  = Play error sound
Has errors → No errors  = Play success sound
Has errors → Has errors = No sound
No errors → No errors   = No sound

License

MIT License - Feel free to modify and distribute

Contributing

Suggestions and improvements welcome!

Future Enhancements

  • [ ] Configuration settings for custom sound paths
  • [ ] Volume control
  • [ ] Option to filter by error severity
  • [ ] Different sounds for warnings vs errors
  • [ ] Visual notifications alongside sounds
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft