Skip to content

CGastrell/r2d2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

r2d2

Sound notifier

Description

Plays a random R2-D2 sound (ogg) as a notification from console or cli.

The sound is played with gstreamer. It WON'T work without it.

Install

npm install r2d2 --save

Usage

Create an instance and call headsUp():

var notifier = require('r2d2');

notifier.headsUp(function(error, stdin, stdout){
  if(err) {
    console.error('Error: couldn\'t play sound because:');
    console.error(err.stack);
  }
  console.log('You\'ve been notified');
});

API

headsUp([callback])

Plays a random sound and executes callback. Callback signature is forwarded from child_process.exec: error, stdin, stdout

Just for fun and testing

About

node test with play-sound

Resources

Stars

Watchers

Forks

Packages

No packages published