Created
February 13, 2013 07:47
-
-
Save TooTallNate/4942956 to your computer and use it in GitHub Desktop.
node-ogg + node-vorbis encoder example
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
/** | |
* Module dependencies. | |
*/ | |
var ogg = require('ogg'); | |
var vorbis = require('vorbis'); | |
var oe = new ogg.Encoder(); | |
var ve = new vorbis.Encoder(); | |
// not yet implemented... | |
//ve.addComment('hello', 'world'); | |
// `process.stdin` must be PCM float 32-bit signed little-endian samples, 2 channels, 44,100hz sample rate | |
// the `channels` and `sampleRate` will be configurable in the future | |
process.stdin.pipe(ve) | |
// send the encoded Vorbis pages to the Ogg encoder | |
ve.pipe(oe.stream()); | |
// write the produced Ogg file with Vorbis audio to `process.stdout` | |
oe.pipe(process.stdout); |
Or it's just erroring out somewhere in the wav library. Going to bed, if you need me to write a working example in any of the readme.md's let me know.
Documentation patches are always welcome :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks. It doesn't look like it's implemented, got this error: TypeError: Object # has no method 'write'
at write (/Users/justinthomas/workspaces/node-ogg/node_modules/wav/node_modules/readable-stream/readable.js:405:24)
at flow (/Users/justinthomas/workspaces/node-ogg/node_modules/wav/node_modules/readable-stream/readable.js:415:7)