title: Playing audio programmatically via NodeJS
body: <p>I've spent the whole day trying to get any of the <code>npm</code>packages related to playing audio from <code>nodejs</code> but couldn't get any to work.</p>
  
  <p>Basically what I need is to play batch audios. </p>
  
  <p>For example:</p>
  
  <pre><code>//files containing the name of the audios
  var files = require('./list-of-audios-to-play.json')
  
  var player = require('play-sound')(opts = {})
  
   var counter = 0;
  
    //every 5 seconds, play the referenced audio
  
    setInterval(function(){
      counter++;
      player.play(files[counter]+'.mp3', function(err){
        if (err) throw err
      })
    },5000)
  </code></pre>
  
  <p>Tried everything.</p>
  
  <p>When I run the above code, I get this error:</p>
  
  <pre><code>INFORMATION: wasnt possible to locate files for the specified pattern(s)
  events.js:183
        throw er; // Unhandled 'error' event
        ^
  
  Error: spawn play ENOENT
      at _errnoException (util.js:1022:11)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
      at onErrorNT (internal/child_process.js:372:16)
      at _combinedTickCallback (internal/process/next_tick.js:138:11)
      at process._tickCallback (internal/process/next_tick.js:180:9)
      at Function.Module.runMain (module.js:695:11)
      at startup (bootstrap_node.js:188:16)
      at bootstrap_node.js:609:3
  </code></pre>
  
  <p>Can anyone help?  </p>