Skip to content

Instantly share code, notes, and snippets.

@fearphage
Forked from TooTallNate/mp3player.js
Created October 24, 2012 20:39
Show Gist options
  • Save fearphage/3948720 to your computer and use it in GitHub Desktop.
Save fearphage/3948720 to your computer and use it in GitHub Desktop.
node.js command line MP3 player in 9 lines of code!
var fs = require('fs');
var lame = require('lame');
var Speaker = require('speaker');
fs.createReadStream(process.argv[2])
.pipe(new lame.Decoder())
.on('format', function (format) {
this.pipe(new Speaker(format));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment