Skip to content

vitrionbv/play-sound

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@vitrion/play-sound

⚠️ This is a Fork

This package is a fork of play-sound as the original package is no longer maintained. Please use this forked version instead.

Note: It is recommended to review the forked package, verify its compatibility with your project, and assess any potential risks or issues before adoption.

Downloads

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

Installation

npm install @vitrion/play-sound

Examples

const 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
const audio = player.play('foo.mp3', function(err){
if (err && !err.killed) throw err
})
audio.kill()

Options

License

MIT

Please update this README to be more modern and change the text to be more professional. You can find the updated README here.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published