2016-10-22 22:19:10 +02:00
2014-09-18 22:27:01 +02:00
2014-09-12 11:33:42 +02:00
2014-09-09 00:08:40 +02:00
2016-10-22 22:08:25 +02:00
2016-10-22 22:13:16 +02:00
2016-10-22 22:19:10 +02:00

play-sound

Build Status Downloads

Play sounds by shelling out to one of the available audio players.

Installation

npm install play-sound

Examples

var player = require('play-sound')(opts = {})

// $ mplayer foo.mp3 
player.play('foo.mp3', function(err){
  if (err) throw err
})

// { timeout: 300 } will be passed to child process
player.play('foo.mp3', { timeout: 300 }, function(err){
  if (err) throw err
})

// configure arguments for executable if any
player.play('foo.mp3', { afplay: ['-v', 1 ] /* lower volume for afplay on OSX */ }, function(err){
  if (err) throw err
})

// access the node child_process in case you need to kill it on demand
var audio = player.play('foo.mp3', function(err){
  if (err && !err.killed) throw err
})
audio.kill()

Options

Prior art

  • play.js - play sound files from node.js to your speakers

License

MIT

S
Description
No description provided
Readme MIT
105 KiB
Languages
JavaScript 100%