-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a performant alternative to node-opus #3678
Comments
It was brought to our attention that Are you able to uninstall node-opus and try opusscript (wasm mode is enabled by default), then check if it works and compare it to node-opus in a supported version? Having some metrics about how Wasm performs versus C++ Addons would be interesting. |
No, sorry. I wouldn't know where to start. I'm not really a user of discord.js. Just wanted to notify you that node-opus might not be that great of a long term solution anymore. |
Thanks for the heads up @Rantanen. Also a thanks from us and our community for Regarding the benchmarks, I ran a rough one and found that to process a 3 minute 20 seconds audio file:
I think for most users, using |
Good to hear! I'm sure the wasm version is easier to maintain and breaks less often too! |
@Rantanen if V8 breakage is the problem, you might want to look at n-api. it's ABI stable across all versions of node that have it. There is also a C++ wrapper available. |
@devsnek Yeah, that would be a solution, like mentioned in the original issue. Unfortunately I don't really have interest in putting that effort into node-opus anymore. :( I feel like the NodeJS community would be better served by an Opus implementation that has an author who actually wants to provide a good NodeJS Opus implementation instead of one that just wants open GitHub issues to go away. :) |
Thank you for your efforts @Rantanen! I took the task and rewrote it here: https://github.com/discordjs/opus Since I based this off your code (not that there was a lot, like you said its a very thin wrapper to begin with) I made sure to put you into the copyright notice. |
Took me this long to finally do it but it's official now. The Rantanen/node-opus repository has been archived, the npm package has been deprecated and it's directing people to use @discordjs/opus instead. Thanks @iCrawl for implementing the N-API alternative! ❤️ |
Is your feature request related to a problem? Please describe.
node-opus keeps breaking on every other Node.js release due to V8 API changes
Describe the ideal solution
Provide a native alternative for node-opus on top of N-API. I don't expect this to be a difficult task - the (raw) API node-opus provides follows the libopus API closely and the native bits are a very thin wrapper around that API to make it available to JS.
Describe alternatives you've considered
None
Additional context
I'm getting a bit tired of keeping node-opus up to date with the ever changing V8 APIs. Currently I have no intention in making node-opus compatible with the latest Node version (12.x?). It feels like 90%+ of its users are discord bots, so I felt like giving this project a heads up.
The text was updated successfully, but these errors were encountered: