npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@4players/odin-nodejs

v0.10.3

Published

NodeJS bindings for the ODIN SDK. Use for AI enhanced human interactions, content moderation and audio processing features in a backend.

Downloads

21

Readme

ODIN Node JS

Native Node JS bindings for the ODIN SDK. It is based on the ODIN Native SDK and wraps the C++ code into a Node JS module.

Check out documentation and guides at developers.4players.io.

Beta!

This SDK is currently in beta. This means that the API is not final and might change in the future. It's also not ready for production use as there might be bugs, memory leaks or other issues. But it's good enough for testing AI integration, recording or other interesting use cases.

If you have any questions or feedback, please reach out to us at our Discord Server.

ODIN Node JS compared to Web SDK

We have a JavaScript/TypeScript SDK that has fallback code for WebRTC and can be used in the browser. While this also works on NodeJS (to some extent) it is not as performant as the native bindings and also has some limitations. For bots and other advanced use cases we provide this native Node JS SDK.

While we try to keep the API as similar as possible, there are some differences. While wrapping things in objects in JavaScript and TypeScript for better separating doing so in native C/C++ is harder and error prone. Therefore we decided to only use C/C++ and objects where required. For example, the WebSDK provides an OdinPeer object that wraps various methods and properties. For bots and other NodeJS use cases you typically don't need that and therefore we decided to not make things more complex than required. You typically only get a peerId and mediaId and that's it. But for most use cases this is enough, and you are always free to build your own wrapper where required.

The most prominent difference is, that the NodeJS SDK allows you to get the raw audio data from the ODIN server. This allows you to record audio or sending audio into the room. While the WebSDK provides a similar functionality it is based on Web Audio that is not available on NodeJS - therefore it does not make much sense to wrap and polyfill all of that while it's super easy (and fast) to wrap the ODIN native SDK into NodeJS bindings.

Having two libs also allows us to optimize for each platform without having to work through many use cases.

Prerequisites

This NodeJS SDK is based on the native ODIN SDK and is implemented via Native NodeJS bindings. This means that during npm install this module will be compiled, which means you may need to have a compiler installed.

For some target systems, precompiled libraries are provided:

  • macOS (x86_64 and arm64)
  • Windows (x86_64)
  • Linux (x86_64)

Otherwise you need to have a C++ compiler installed. On macOS, you can install XCode and the command line tools. On Linux you need to have GCC installed. More information can be found here: node-gyp.

Getting Started and compiling

Add the package to your project:

npm install --save @4players/odin-nodejs

This will compile the NodeJS bindings for the "local" machine. We provide a few precompiled libraries so you don't need to have GCC and compilers installed. This is especially useful for CI/CD pipelines.

Dependencies

It has deps to the native ODIN SDK. A couple of libraries for typical use cases (i.e. macOS, Windows and Linux) is provided in the libs folder. If you have some fancy platform, you might need to compile the ODIN SDK and put the lib in the folder according this name scheme: platform-arch.

Examples

We provide a few examples in the tests folder to get you started quickly.