Overview
This is the core client API implemented in Rust and exported to native C libraries. These libraries are the low-level building blocks for our high-level SDKs like Unity SDK or Unreal SDK.
Please check out our public Github repository for source code and a CLI application example.
Usage
Quick Start
The Core SDK now uses a Connection Pool to manage connections efficiently. The following example demonstrates how to initialize the SDK, create a connection pool, and join a room.
Authentication
To enter a room, an authentication token is required. ODIN uses signed JSON Web Tokens (JWT). Use the OdinTokenGenerator to create these tokens locally for testing, or generate them on your backend.
Your Access Key is a sensitive credential. Do not embed it in your client-side code in production. Use a backend service to issue tokens.
Event Handling (RPC)
The ODIN Core SDK uses an event-driven architecture based on RPC (Remote Procedure Calls). Events such as users joining, media starting, or messages received are delivered as MessagePack encoded data to the on_rpc callback defined in your connection pool settings.
To handle these events, you must:
- Register an
on_rpccallback inOdinConnectionPoolSettings. - Deserialize the
bytespayload using a MessagePack library (and/or JSON parser). - Process the event based on its structure.
See Event Structures for a detailed reference of the available event schemas.
Audio Talk-Status Events
For performance-critical talk-status specific updates (Voice Activity Detection), you can register direct callbacks on encoders and decoders using odin_encoder_set_event_callback and odin_decoder_set_event_callback.
Media Streams
ODIN uses an explicit signaling mechanism to manage media streams. You must send RPC commands to the server to Start, Stop, Pause, or Resume media.
Starting Media
To transmit audio, you must first create an audio stream (likely initializing your microphone) and then signal the room that you are starting media.
For a complete implementation of audio capture and media signaling, refer to the Minimal Client Sample.
Audio Processing
The Audio Processing Module (APM) handles echo cancellation, noise suppression, and gain control. You can configure it by applying an OdinApmConfig to your audio pipeline.
User Data & Messages
Arbitrary data updates (User Data) and Messages are also handled via RPC commands (UpdatePeer, SendMessage). Sending a message to all peers involves sending a SendMessage RPC command with your binary payload.
See Event Structures for the MessageReceived event format.