Created
August 9, 2010 03:24
-
-
Save steveh/514882 to your computer and use it in GitHub Desktop.
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 sys = require('sys'), | |
spawn = require('child_process').spawn, | |
http = require('http'); | |
http.createServer(function (req, res) { | |
var ffmpeg = spawn('ffmpeg', ['-i /path/to/file', '-f mp3', '-']); | |
res.writeHead(200, {'Content-Type': 'audio/mpeg'}); | |
ffmpeg.stdout.addListener('data', function (d) { | |
res.write(d); | |
}); | |
}).listen(8000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment