Exciting news!Announcing our $4.6M Series Seed. Learn more
Log in


Package Overview
File Explorer

Advanced tools


Sound effects for your node programs


Version published
Yearly downloads
decreased by-24.5%

Weekly downloads




Add some sound to your node programs.

Want a notification when your node program has finished executing? Want a beep whenever your program has encountered an error? Ever just wanted your error messages read out? node-sfx is for you.


Install sfx via npm.

npm install sfx

And require it in your program.

var sfx = require("sfx");


sfx aims to provide a simple, consistent, cross-platformish API for your sound effects in your node programs.

sfx.play( sound [, volume, rate, callback] )

Play a sound. sound is a path to a sound file or a name of sound file in the sounds/ directory (without the extension). Specifiying "random" for the sound parameter plays a random sound from the library. volume is a number between 1-100. rate is the speed the sound effect is played at (experimental). And finally, callback is called on complete.

sfx.play("/System/Library/Sounds/Ping.aiff"); sfx.play("ping"); sfx.play("ping", 100);

sfx.say( string [, voice, callback] ) (OSX only for now)

Use text-to-speech to hear a string spoke aloud. string is the string to speak. voice is to specify a voice to speak with. Available voices (OSX only) are: Agnes, Albert, Alex, Bad News, Bahh, Bells, Boing, Bruce, Bubbles, Cellos, Deranged, Fred, Good News, Hysterical, Junior, Kathy, Pipe Organ, Princess, Ralph, Trinoids, Vicki, Victoria, Whisper, Zarvox and "random" to use a random voice.

sfx.say("The human torch was denied a bank loan."); sfx.say("The arsonist has oddly shaped feet.", "Hysterical"); sfx.say("The skeleton ran out of shampoo in the shower.", "random");

sfx.[sound]( [volume, rate] )

Sounds in the library (without their extension) can also be called directly from the sfx for easy access. sound is the name of sound within the sound/ library.

sfx.ping(); sfx.hero(); sfx.random(); // Play a random sound

Example uses

Use sfx to read out your logs (but it's probably a bad idea).

var _log = console.log; console.log = function() { sfx.say(Array.prototype.join.call(arguments, ". ")); _log.apply(console, arguments); }

Make sfx dunk on an error.

db.on("error", function(err) { sfx.funk(function() { throw err; }); });

Have a nice alert when your script is finished running.

operation.on("complete", function() { sfx.pop(function() { process.exit(); }) });

Your website's traffic is fading and every request is a good request so it should have a happy sound.

app.get("/", function(req, res) { sfx.hero(); });

Got any cool examples? Submit a pull request and I'd be happy to put it here.


Have a cool sound to contribute? Make sure it's less than 250kb, stick it in the sounds/ directory and submit a pull request.


  • Add a little sound package manager hosted on Github so you can selectively retrieve sounds. sfx add hooray which adds the hooray sound to the global sfx sound directory. Sound files could get large and ain't nobody got time for that.



The sounds within the sounds/ directory are the factory sounds provided in /System/Library/Sounds in OSX. I have no idea what the licensing on these sounds. If anyone can inform me of the license, it would be greatly appreciated.



What is sfx?

Sound effects for your node programs

Is sfx popular?

The npm package sfx receives a total of 124 weekly downloads. As such, sfx popularity was classified as not popular.

Is sfx well maintained?

We found that sfx demonstrated a not healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.

Last updated on 07 Jan 2014


Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc