-
Notifications
You must be signed in to change notification settings - Fork 32
Broken on Node 10 and 11 #69
Comments
I noted something similar with Looked into this a bit further. This is a bug in Node: The ogg |
On the other hand, that specific case seems to have been fixed in Node v10.9, but I still have the issue with Node v10.10. |
Reported in Node: nodejs/node#24915 A really dirty workaround to this is to force fs.createReadStream('input.opus')
.on('error', console.error)
.pipe(oggDecoder)
.on('error', console.error)
.on('stream', (stream) => {
stream._readableState.highWaterMark = 1; // Force highWaterMark > 0.
stream
.pipe(opusDecoder)
.on('error', console.error)
.on('format', (format) => {
opusDecoder
.pipe(fs.createWriteStream('out.pcm'))
.on('error', console.error);
});
}); I just did that in our own unit tests: Lines 42 to 48 in 9faf2e4
|
Also reported in |
The fix for the Node issue landed in Node master: nodejs/node@37a5e01 I don't really know how Node point releases work so can't say when that might be available in the 11.x branch. I'll leave this issue open until the fix becomes available in a Node release (mainly so I remember to remove the workaround from the Decoder tests). |
That's quite a rabbit hole to go down. Thanks so much for getting on top of this and quickly. :) |
Node 11.5 has been released with your patch! |
And our test suite passes now, using Node 11.5.0. Awesome work and thanks again. If there is somewhere I can donate money for this project, please let me know. :) |
Hello and thanks for this awesome project!
I have been successfully using this on Node 8, but in trying to upgrade our app to Node 10, I discovered that
node-opus
seems to not output anything in newer versions of Node. It caused our test suite to hang for some reason. I haven't been able to make a minimal reproduction ofnode-opus
hanging even though it seems to in our app. In the example below, it just outputs zero bytes rather than hanging. Either way, seems to be very broken.Reproducible example
The code below is more or less the same as examples/stream-to-alsa.js, except it simply writes the decoded bytes to a file.
Good (Node 8)
306 Kilobytes
Bad (Node 10)
0 Bytes
The text was updated successfully, but these errors were encountered: