
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
simple-notification-sounds
Advanced tools
Simple, tree-shakable browser audio notifications (success, alert, warning, attention, error) with short, medium, and long sounds.
A lightweight, flexible library for adding meaningful audio cues to web applications. This library provides distinct notification sounds that are designed to convey information even in environments where users may not be looking at the screen.
🎮 Try the interactive demo to hear all the different sounds!
npm install simple-notification-sounds
import {
playSuccess,
playAttention,
playAlert,
playWarning,
playError,
} from "simple-notification-sounds";
// Play a medium success sound (default)
playSuccess();
// Play a short attention sound
playAttention("short");
// Play a long warning sound
playWarning("long");
After publishing to npm, you can use the package directly from CDN:
<!-- From unpkg -->
<script src="https://unpkg.com/simple-notification-sounds@latest/dist/simple-notification-sounds.umd.js"></script>
<!-- OR from jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/simple-notification-sounds@latest/dist/simple-notification-sounds.umd.js"></script>
<script>
// Play a medium attention sound (default)
SimpleNotificationSounds.playAttention();
// Play a short error sound
SimpleNotificationSounds.playError("short");
</script>
<script src="dist/simple-notification-sounds.umd.js"></script>
<script>
// Play a medium attention sound (default)
SimpleNotificationSounds.playAttention();
// Play a short error sound
SimpleNotificationSounds.playError("short");
</script>
Each sound is carefully designed with distinctive audio characteristics to convey specific meanings without requiring visual confirmation.
Success sounds use bright, harmonically rich tones with upward musical patterns that are universally recognized as positive.
Real-world usage: Scan completions, form submissions, transaction approvals, batch processing completions
Attention sounds use clear, focused tones that are designed to gently draw the user's focus without urgency.
Real-world usage: Reminders, non-critical updates, user prompts, background notifications
Alert sounds use attention-grabbing tones designed to demand immediate focus, with patterns that cut through background noise.
Real-world usage: Critical system notifications, time-sensitive alerts, security warnings, emergency alerts
Warning sounds use slightly dissonant tones that indicate caution without the full urgency of alerts.
Real-world usage: Input validation errors, low battery/resources warnings, approaching thresholds, preventative notifications
Error sounds use harsh, buzzy tones with dissonant intervals that clearly indicate something is wrong.
Real-world usage: Processing failures, authentication errors, system malfunctions, critical exceptions
The sounds in this library are specifically designed for scenarios where users may not be looking at the screen, such as:
Each sound is carefully crafted with distinct timbres, musical patterns, and frequencies to ensure they remain distinguishable even in noisy environments.
This library uses a direct code approach rather than loading audio files or distributing through CDN for several key reasons:
While distributing pre-recorded audio files via CDN might have simplified implementation, the current approach offers superior flexibility, performance, and user experience, especially for applications that need to function in environments with limited connectivity.
However, for convenience, this library is published to npm and automatically available through unpkg and jsDelivr CDNs, allowing you to include it in your projects without installing via npm.
This library uses the Web Audio API and is compatible with all modern browsers:
MIT
FAQs
Simple, tree-shakable browser audio notifications (success, alert, warning, attention, error) with short, medium, and long sounds.
We found that simple-notification-sounds demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.