Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Code Execution Sound AlertNew to Visual Studio Code? Get it now.
Code Execution Sound Alert

Code Execution Sound Alert

Gaurav Mehta

|
14 installs
| (1) | Free
Plays different sounds when a user runs code in the VS Code terminal depending on the result.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Code Execution Sound Alert

A Visual Studio Code extension that plays custom sound alerts when a terminal command finishes executing, depending on the execution result.

Features

  1. Detects when a terminal command finishes executing.
  2. Captures and analyzes the terminal output using the modernized shell execution VS Code API.
  3. Plays different sounds for:
    • Success: Plays success.mp3 when execution finishes normally.
    • Runtime Error: Plays error.mp3 when keywords such as "error", "exception", or "failed" are detected, or the process exits with a non-zero code.
    • Compile Error: Plays compile.mp3 when compilation errors are found (e.g., "compilation error", "syntax error").
  4. Visual Notifications: Shows a notification message along with the sound whenever a run is complete.
  5. Highly Configureable: Enable/disable sounds or assign custom audio file paths right in the VS Code Settings!

Requirements

  • VS Code version 1.86.0 or higher.
  • Node.js installed to build the extension from source.
  • An OS audio player. By default, play-sound uses built in OS audio capabilities (like native Windows scripts or Mac's afplay).

Extension Settings

You can configure the extension through VS Code settings via File > Preferences > Settings:

  • codeSound.enable: Enable or disable the sound alerts. (Default: true)
  • codeSound.successSound: Path to the success sound file.
  • codeSound.errorSound: Path to the runtime error sound file.
  • codeSound.compileSound: Path to the compile error sound file.

Paths can be absolute strings leading to anywhere on your disk, or relative to the extension folder if you replace the bundled sounds.

🚀 Getting Started

If you want to run or modify this extension locally:

1. Install Dependencies

Open a terminal in the folder where you created this project (code-execution-sound-alert) and run:

npm install

2. Add Sound Files

To keep the zip sizes small and respect licensing, this template comes with dummy placeholder files. You MUST replace them with your actual sound files! Add your actual .mp3 files exactly where the dummies are in the sounds/ directory:

  • sounds/success.mp3
  • sounds/error.mp3
  • sounds/compile.mp3

3. Run the Extension locally (F5)

  1. Open this code-execution-sound-alert folder deeply inside VS Code.
  2. Press F5 on your keyboard to start debugging.
  3. A new Extension Development Host window will pop up.
  4. Try running a command that causes an error in your terminal or executes fine (e.g. node -e "throw new Error('boom')") to hear the custom sounds!

📦 Packaging the Extension

To package the extension into a standalone .vsix file so you can install it on any machine:

  1. Install vsce globally if you haven't already:
    npm install -g @vscode/vsce
    
  2. Run the packaging command:
    vsce package
    
  3. After packaging, you'll see a .vsix file. You can install it in standard VS Code directly from the Extensions View using the Install from VSIX... command!
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft