UOdinFunctionLibrary
- Header:
#include "OdinFunctionLibrary.h" - Module:
Odin - Inherits from:
UBlueprintFunctionLibrary - Blueprint: Reflected (UCLASS) · Blueprint reference
Overview
Functions
| Name | Description |
|---|---|
GenerateAccessKey | Generates a new random access key, e.g. |
FormatOdinError | Converts an ODIN error code into a human-readable string description. |
OdinStringToBytes | Helper to convert a String to a UTF-8 Byte Array. |
OdinHexStringToBytes | Converts a hexadecimal string (e.g. |
OdinBytesToString | Converts a UTF-8 byte array to a string. |
OdinBytesToHexString | Converts bytes to a hexadecimal string. |
CreateOdinAudioCapture | Creates an Odin Audio Capture object, which records audio from the operating system's input devices. |
CreateOdinEncoderFromGenerator | Creates encoder with the samplerate and channel count from the generator. |
LinkEncoderToRoom | Links an encoder to a room. |
UnlinkEncoderFromRoom | Unlinks an encoder from a room. |
RegisterDecoder | Registers a decoder for a peer of a room, so the decoder receives the peer's audio. |
GetDecodersForPeer | Finds all decoders associated with a specific peer. |
GetRoomsByName | Returns all rooms that were created with the given room ID. |
DeregisterDecoderFromAllConnections | Deregisters the specified decoder from all active connections. |
Conv_OdinPositionToVector | Converts an Odin Position to a Vector. |
Conv_VectorToOdinPosition | Converts a Vector to an Odin Position. |
CreateChannelMask | Creates a channel mask from a map of channel indices (0-63) to enabled flags. |
SetChannels | Enables or disables the channels in the map on an existing mask. |
SetChannelsEnabled | Enables the given channels on an existing mask. |
SetChannelsDisabled | Disables the given channels on an existing mask. |
CreateChannelMaskFromEnabled | Creates a channel mask in which only the given channels are enabled. |
CreateChannelMaskFromDisabled | Creates a channel mask in which all channels except the given ones are enabled. |
SetChannelInMask | Enables or disables one channel of an existing mask. |
IsChannelEnabledInMask | Returns whether a channel is enabled in the mask. |
CreateFullMask | Creates a channel mask with all 64 channels enabled. |
CreateEmptyMask | Creates a channel mask with no channels enabled. |
DoesAudioEventMatchFilter | Returns true if the audio event is part of the filter bitmask, e.g. |
OdinDebugDumpState | Returns a text dump of the internal state of the native ODIN library for debugging, e.g. |
Functions
GenerateAccessKey
Static · Blueprint: Generate Access Key
Generates a new random access key, e.g. for local testing. Room tokens are signed with an access key; for production, use the key from your ODIN dashboard and generate tokens on a server.
Returns FString – The generated access key.
FormatOdinError
Static · Blueprint: Format Odin Error
Converts an ODIN error code into a human-readable string description.
| Parameter | Type | Description |
|---|---|---|
Code | EOdinError | The error code. |
bUETrace | bool | Include UE trace. |
Returns FString – Human-readable error.
OdinStringToBytes
Static · Blueprint: Odin String to Bytes
Helper to convert a String to a UTF-8 Byte Array. Useful for raw data messages.
| Parameter | Type | Description |
|---|---|---|
Str | const FString& | String to convert. |
Buffer | TArray<uint8>& | Output byte array. |
OdinHexStringToBytes
Static · Blueprint: Odin Hex String to Bytes
Converts a hexadecimal string (e.g. 0a1b2c) to bytes. Returns an empty array if the string contains other characters.
| Parameter | Type | Description |
|---|---|---|
Str | const FString& | |
Buffer | TArray<uint8>& |
OdinBytesToString
Static · Blueprint: Odin Bytes to String
Converts a UTF-8 byte array to a string.
| Parameter | Type | Description |
|---|---|---|
Buffer | const TArray<uint8>& | Byte array. |
Str | FString& | Output string. |
OdinBytesToHexString
Static · Blueprint: Odin Bytes to Hex String
Converts bytes to a hexadecimal string.
| Parameter | Type | Description |
|---|---|---|
Buffer | const TArray<uint8>& | |
Str | FString& |
CreateOdinAudioCapture
Static · Blueprint: Create Odin Audio Capture
Creates an Odin Audio Capture object, which records audio from the operating system's input devices. This is the first step to set up microphone input. Don't forget to call Start Capturing on it.
| Parameter | Type | Description |
|---|---|---|
WorldContextObject | UObject* |
Returns UOdinAudioCapture* – The audio capture object.
CreateOdinEncoderFromGenerator
Static · Blueprint: Create Odin Encoder from Generator
Creates encoder with the samplerate and channel count from the generator. The encoder will automatically use the generator as audio source. Will also automatically link the encoder to the provided Odin Room.
| Parameter | Type | Description |
|---|---|---|
WorldContextObject | UObject* | |
OdinRoom | UOdinRoom*& | The Odin Room that the encoder should be linked to. |
AudioGenerator | UAudioGenerator*& | The audio generator that should be used as audio source for the encoder. |
Returns UOdinEncoder* – The created encoder, already linked to the room.
LinkEncoderToRoom
Static · Blueprint: Link Encoder to Room
Links an encoder to a room. Audio from the encoder will be sent to the room.
| Parameter | Type | Description |
|---|---|---|
Encoder | UOdinEncoder* | |
Room | UOdinRoom* |
UnlinkEncoderFromRoom
Static · Blueprint: Unlink Encoder from Room
Unlinks an encoder from a room. Audio from the encoder will no longer be sent to the room.
| Parameter | Type | Description |
|---|---|---|
Encoder | UOdinEncoder* |
RegisterDecoder
Static · Blueprint: Register Decoder to Peer
Registers a decoder for a peer of a room, so the decoder receives the peer's audio. To remove it, use Deregister Decoder From All. A decoder can only be registered to one peer at a time.
| Parameter | Type | Description |
|---|---|---|
Decoder | UOdinDecoder* | The decoder. |
Room | UOdinRoom* | The room. |
PeerId | int64 | Target peer ID. |
GetDecodersForPeer
Static · Blueprint: Get Decoders for Peer
Finds all decoders associated with a specific peer.
| Parameter | Type | Description |
|---|---|---|
Room | UOdinRoom* | The room. |
PeerId | int64 | The peer ID. |
Returns TArray<UOdinDecoder*> – Array of decoders.
GetRoomsByName
Static · Blueprint: Get Rooms by Name
Returns all rooms that were created with the given room ID.
| Parameter | Type | Description |
|---|---|---|
RoomId | const FString& | The room identifier. |
Returns TArray<UOdinRoom*> – Array of rooms.
DeregisterDecoderFromAllConnections
Static · Blueprint: Deregister Decoder From All
Deregisters the specified decoder from all active connections.
| Parameter | Type | Description |
|---|---|---|
Decoder | UOdinDecoder* | The decoder to deregister. |
Conv_OdinPositionToVector
Static · Blueprint: To Vector
Converts an Odin Position to a Vector. This is an autocast node: the editor inserts it automatically when you connect the two pin types.
| Parameter | Type | Description |
|---|---|---|
InPosition | FOdinPosition |
Returns FVector
Conv_VectorToOdinPosition
Static · Blueprint: To Odin Position
Converts a Vector to an Odin Position. This is an autocast node: the editor inserts it automatically when you connect the two pin types.
| Parameter | Type | Description |
|---|---|---|
InPosition | const FVector& |
Returns FOdinPosition
CreateChannelMask
Static · Blueprint: Create Channel Mask
Creates a channel mask from a map of channel indices (0-63) to enabled flags. Channels that are not in the map get the Default Value.
| Parameter | Type | Description |
|---|---|---|
Channels | const TMap<int32, bool>& | Channel index mapped to whether the channel is enabled. |
bDefaultValue | bool | Whether the channels that are not in the map are enabled. |
Returns FOdinChannelMask – The channel mask.
SetChannels
Static · Blueprint: Set Channels
Enables or disables the channels in the map on an existing mask.
| Parameter | Type | Description |
|---|---|---|
Mask | FOdinChannelMask& | The mask to change. |
Channels | const TMap<int32, bool>& | Channel index mapped to whether the channel is enabled. |
SetChannelsEnabled
Static · Blueprint: Set Channels Enabled
Enables the given channels on an existing mask.
| Parameter | Type | Description |
|---|---|---|
Mask | FOdinChannelMask& | The mask to change. |
EnabledChannels | const TArray<int32>& | Indices of the channels to enable. |
SetChannelsDisabled
Static · Blueprint: Set Channels Disabled
Disables the given channels on an existing mask.
| Parameter | Type | Description |
|---|---|---|
Mask | FOdinChannelMask& | The mask to change. |
DisabledChannels | const TArray<int32>& | Indices of the channels to disable. |
CreateChannelMaskFromEnabled
Static · Blueprint: Create Channel Mask from Enabled
Creates a channel mask in which only the given channels are enabled.
| Parameter | Type | Description |
|---|---|---|
EnabledChannels | const TArray<int32>& | Indices of the channels to enable. |
Returns FOdinChannelMask
CreateChannelMaskFromDisabled
Static · Blueprint: Create Channel Mask from Disabled
Creates a channel mask in which all channels except the given ones are enabled.
| Parameter | Type | Description |
|---|---|---|
DisabledChannels | const TArray<int32>& | Indices of the channels to disable. |
Returns FOdinChannelMask
SetChannelInMask
Static · Blueprint: Set Channel in Mask
Enables or disables one channel of an existing mask.
| Parameter | Type | Description |
|---|---|---|
Mask | FOdinChannelMask& | The mask to change. |
ChannelIndex | int32 | Index of the channel, 0-63. |
bEnabled | bool | Whether the channel is enabled. |
IsChannelEnabledInMask
Static · Blueprint: Is Channel Enabled in Mask
Returns whether a channel is enabled in the mask.
| Parameter | Type | Description |
|---|---|---|
Mask | const FOdinChannelMask& | |
ChannelIndex | const int32 | Index of the channel, 0-63. |
Returns bool
CreateFullMask
Static · Blueprint: Create Full Mask
Creates a channel mask with all 64 channels enabled.
Returns FOdinChannelMask – Full mask.
Do not use a full mask for Set Encoder Position: an encoder holds at most 12 channel positions, so a full mask fails with ODIN_ERROR_AUDIO_POSITION_LIMIT_REACHED. Mask only the channels that are actually transmitted on (usually just channel 0).
CreateEmptyMask
Static · Blueprint: Create Empty Mask
Creates a channel mask with no channels enabled.
Returns FOdinChannelMask – Empty mask.
DoesAudioEventMatchFilter
Static · Blueprint: Does Audio Event Match Filter
Returns true if the audio event is part of the filter bitmask, e.g. to check the Filter output of On Audio Event.
| Parameter | Type | Description |
|---|---|---|
Event | EOdinAudioEvents | |
Filter | int32 |
Returns bool
OdinDebugDumpState
Static · Blueprint: Odin Debug Dump State
Returns a text dump of the internal state of the native ODIN library for debugging, e.g. to attach to a support request.
Returns FString