Faah Sound on Terminal Error 🔊
A VS Code extension that plays a "faah" sound whenever an error appears in your terminal. Perfect for catching errors when you're multitasking!
Features
- 🎵 Automatically plays a sound when terminal errors are detected
- ⚙️ Configurable error patterns to match
- 🔊 Adjustable volume control
- 🎮 Easy toggle on/off
- 🧪 Test sound command to verify it's working
Installation
Step 1: Add Your Sound File
- Place your "faah" sound file in the
sounds/ directory
- Name it
faah.mp3 (or update the extension accordingly)
- Supported formats: MP3, WAV, OGG
Where to get a "faah" sound:
- Record your own
- Use text-to-speech services (e.g., Google TTS, Amazon Polly)
- Download from free sound libraries like freesound.org
Step 2: Install Dependencies
cd "Faah extension"
npm install
Step 3: Test the Extension
Press F5 in VS Code to open a new Extension Development Host window.
Step 4: Test It Out
In the new window:
- Open a terminal
- Run a command that causes an error (e.g.,
ls nonexistentfile)
- You should hear the "faah" sound!
Commands
- Faah Sound: Toggle Error Sound - Enable/disable the sound
- Faah Sound: Test Sound - Play the sound to test it's working
Access commands via Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
Configuration
Open VS Code settings and search for "Faah Sound" to configure:
faahSoundError.enabled
- Type:
boolean
- Default:
true
- Description: Enable/disable the faah sound on terminal errors
faahSoundError.volume
- Type:
number
- Default:
0.5
- Range:
0.0 to 1.0
- Description: Volume level for the faah sound
faahSoundError.errorPatterns
- Type:
array
- Default:
[
"error:",
"Error:",
"ERROR:",
"fail:",
"FAIL:",
"Failed",
"fatal:",
"FATAL:",
"Exception",
"Traceback"
]
- Description: Patterns to detect errors in terminal output
Audio Player Requirements
The extension uses system audio players to play sounds:
- Linux: Requires
paplay (PulseAudio), aplay (ALSA), or ffplay (FFmpeg)
- macOS: Uses built-in
afplay
- Windows: Uses PowerShell's SoundPlayer
Installing Audio Players (Linux)
If you don't have an audio player installed:
# For Ubuntu/Debian (PulseAudio)
sudo apt-get install pulseaudio-utils
# For ALSA
sudo apt-get install alsa-utils
# For FFmpeg
sudo apt-get install ffmpeg
Packaging the Extension
To package and install the extension:
Install vsce (VS Code Extension Manager):
npm install -g @vscode/vsce
Package the extension:
vsce package
Install the .vsix file:
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X)
- Click the "..." menu → "Install from VSIX"
- Select the generated
.vsix file
Publishing (Optional)
To publish to the VS Code Marketplace:
- Create a publisher account at https://marketplace.visualstudio.com/
- Update
publisher in package.json
- Run:
vsce publish
How It Works
- The extension monitors all terminal output using VS Code's
onDidWriteTerminalData event
- When terminal data is written, it checks against configured error patterns
- If an error pattern is matched, it plays the sound file
- The sound is played using system audio players (platform-specific)
Troubleshooting
Sound not playing?
- Check the sound file exists: Make sure
sounds/faah.mp3 exists
- Test the sound: Use the "Faah Sound: Test Sound" command
- Check audio player: Ensure you have a compatible audio player installed (see requirements)
- Check system volume: Make sure your system volume is not muted
- Check extension logs: Open Output panel → select "Faah Sound Error"
Too many false positives?
Adjust the faahSoundError.errorPatterns setting to be more specific to your needs.
Sound too loud/quiet?
Adjust the faahSoundError.volume setting (0.0 to 1.0).
Development
Project Structure
Faah extension/
├── extension.js # Main extension code
├── package.json # Extension manifest
├── sounds/
│ ├── faah.mp3 # Your sound file
│ └── README.txt # Instructions
└── README.md # This file
Testing
- Open the extension folder in VS Code
- Press
F5 to start debugging
- Test in the Extension Development Host window
License
MIT License - Feel free to use and modify!
Contributing
Contributions are welcome! Feel free to:
- Add new features
- Improve error detection
- Add support for more audio formats
- Report bugs or issues
Changelog
1.0.0
- Initial release
- Terminal error detection
- Configurable error patterns
- Volume control
- Toggle command
- Test sound command
Made with ❤️ for developers who want audible error notifications!