shime / play-sound

Play sounds by shelling out to one of the available audio players.
MIT License
208 stars 31 forks source link

Opts is not defined #20

Closed 16alexanders closed 7 years ago

16alexanders commented 7 years ago

When I try to use the module it throws an error....

ReferenceError: opts is not defined

Not sure whats going on here.... when I try to remove (opts = {}) then it says there is no method called .play() can't seem to get around this error

shime commented 7 years ago

Stop defining opts in arguments.

var player = require('play-sound')()

// $ mplayer foo.mp3 
player.play('foo.mp3', function(err){
  if (err) throw err
})
16alexanders commented 7 years ago

Yeah I had use-strict enabled and it didn't like the undeclared variable