プロジェクト
概要
Play sounds by shelling out to one of the available audio players.
デザイン・メディア計測したスター増加
- 24時間
- -3
- 7日間
- -3
- 15日間
- -3
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルplay-sound
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
players– List of available audio players to check. Default:player– Audio player to use (skips availability checks)
Prior art
- play.js - play sound files from node.js to your speakers
License
MIT
関連プロジェクトを探す
読み込み中…