-
-
Save mygoare/64a3e8013b5f60fdc94b to your computer and use it in GitHub Desktop.
node.js command line MP3 player in 9 lines of code!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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