Blueprint Reference
Functions
Name | Description |
---|---|
Construct Local Room Handle | Creates a local room object that will be used to handle events and client side connection settings. Connect the Room output to the Room input of the Room output to handle events like Room Joined or Media Added . |
Make ODIN APM Settings | Creates an APM settings object that can be used to construct a local room handle. |
Generate Room Token | Takes an access key and a room id and creates a room token that is used to join a room. In production this should be done in a protected environment, e.g. your authentication server (see example project `Token ServerĀ“) |
Construct a Token Generator | Creates a token generator that is used to generate room tokens on client side. |
Create Odin Audio Capture | Creates an Odin Audio Capture object, that can be used to get access to the microphone on the users device. The Odin Audio Capture object adds features to the default Unreal Audio Capture, like enabling capture device switching on supported platforms or improved Push-To-Talk features. Please make sure, that the Audio Capture Plugin is enabled. |
Format Error | Takes an ODIN error code and returns an error message a string which can be printed to the log. |
Generate Access Key | Creates an access key that can be used to generate room tokens. These keys are only for development and should not be used in production. |
Add Odin Synth Component | Adds the Odin Synth Component to the specified actor. |
Get and Set Volume Multiplier | GetVolumeMultiplier: Retrieves the current volume multiplier of the capture device’s input. SetVolumeMultiplier: Sets the volume multiplier for the capture device’s input. |
Get and Set Max Volume Multiplier | GetMaxVolumeMultiplier: Retrieves the current maximum volume multiplier value. SetMaxVolumeMultiplier: Sets the new maximum volume multiplier value. |
Events
Name | Description |
---|---|
On Add Media To Room Success | This event is triggered in the |
On Connection State Changed | Handles Connection State Changed events which are called when the connection state changed (i.e. a disconnect to the server). Connect a |
On Room Joined | Handles Room Joined events which are called once the local user has successfully joined a room. Connect a |
On Room User Data Changed | Called whenever the user data of the room changed. Connect a |
On Peer Joined | Called whenever a peer joins the room. Connect a |
On Peer Left | Called whenever a peer leaves the room. Connect to a |
On Peer User Data Changed | Called whenever a peer has changed its user data. Connect to a |
On Media Added | Called whenever a peer has added a media (i.e. activated the microphone). Connect to a |
On Media Removed | Called whenever a peer has removed a media stream. Connect to a |
On Message Received | Called whenever another peer has sent a message. Connect to a |
Delegates
Name | Description |
---|---|
Bind to On Connection State Changed | Listens to on Connection State Changed events from the given Room object and calls the connected event handler of type |
Bind to On Room Joined | Listens on Room Joined events on the given Room object and calls the connected |
Bind to On Room User Data Changed | Bind to Room User Data Changed events in the given Room. |
Bind to On Peer Joined | Listens to Peer Joined events in the given Room object. Peer Joined events will be called whenever a peer joins the room. Will not be called for the local player. Use the |
Bind to On Peer Left | Listens on Peer Left events on the given Room object which will be called whenever a peer left the room. Is not called for the local player. |
Bind to On Peer User Data Changed | Listens to Peer User Data Changed events will be called whenever a peer updates their user data. Is not called for the local player. |
Bind to On Media Added | Listens for On Media Added events will be called whenever a peer has added a media (i.e. activated the microphone). Is not called for the local player. |
Bind to On Media Removed | Listens to On Media Removed will be called whenever a peer has removed a media (i.e. muted the microphone). Is not called for the local player. |
Bind to On Message Received | Listens to On Message Received events will be triggered whenever another peer has sent a message. |
Audio Capture
Name | Description |
---|---|
Construct Local Media | Creates a media object that will be used in the Audio Capture or Odin Audio Capture object to it. |
Get Capture Devices Available | Returns all available capture devices with the device id. IMPORTANT! Use the Async version in case you experience stuttering. The Async version runs asynchronously and uses a callback when the result is available. |
Get Current Audio Capture Device | Returns info on the current capture device. |
Change Capture Device By Id | IMPORTANT! Use the Async version in case you experience stuttering. Updates the capture device and restarts the capture stream of the Audio Capture component. The Async version runs asynchronously and does not block the main thread. |
Change Capture Device By Name | IMPORTANT! Use the Async version in case you experience stuttering. Updates the capture device and restarts the capture stream of the Audio Capture component. The Async version runs asynchronously and does not block the main thread. |
Restart Capturing | Restart the stream, using CurrentSelectedDeviceIndex as the new input. |
Get and Set Is Paused | Get Is Capturing Paused: Returns whether the audio capture is paused. Set Is Capturing Paused: Sets the paused state of the audio capture. |
On Capture Device Reset | Will be called if ODIN recognizes that the selected capture device does not supply data anymore, i.e., if a microphone was unplugged. ODIN will wait for AllowedTimeWithoutStreamUpdate seconds before trying a stream restart. You can set the AllowedTimeWithoutStreamUpdate parameter on the Odin Audio Capture Object. |
On Default Device Changed | Will be called if the Default Device is the currently selected device and if the Default Device was switched by the system. |
Room
Name | Description |
---|---|
Join Room | Joins an ODIN room with the room token provided. Every peer connected to the same room will be able to talk to each other and exchange data. |
Add Media To Room | Adds a previously generated media object to the room. Once this is done, the users microphone input will be sent to other users so they can hear the audio. |
Set Room Position Scale | Sets the multiplicative scale for all coordinates used in position updates. Use this as the maximum radius in which a peer can be heard. The scale value is used to optimize audio streams by not streaming audio data to peer’s that are outside of hearing range. |
Update Peer Position | Updates the position of the own peer in the room. You have to set the scale beforehand via |
Send Message | Sends arbitrary data to a list of target peers to an ODIN room. Every peer connected to the same room will be able to receive the message. |
Get Room Connection Stats | Get statistics for a room connection. This function provides detailed information about the connection status and metrics in an ODIN room. |
Set Room APM Config | Updates audio processing settings for capture media handles in a specific room. This function allows modification of various audio processing parameters for a room. |
Set Room APM Stream Delay | Updates the delay estimate in ms for reverse stream used in echo cancellation. This function modifies the delay settings for a specific room. |
Destroy Local Room Handle | Closes the connection to the server and destroys the local room handle. This function is used to properly disconnect and clean up resources associated with a room. |
Odin Synth Component
Name | Description |
---|---|
Odin Assign Synth to Media | Assign a media stream coming with the Media Added event to the Odin Synth Component which will generate audio output from the incoming stream. |
Reset Odin Media | This function can be used to reset the media handle assigned to the targeted ODIN Synth Component instance. Resetting a media handle will restore it to its default configuration. This operation resets the internal Opus encoder/decoder, ensuring a clean state. Additionally, it clears internal buffers, providing a fresh start. |
Adjust Attenuation | This function is used to modify the Attenuation Settings on the targeted ODIN Synth instance. It is worth noting that Attenuation Settings are only passed to new Active Sounds on start, so modified Attenuation data should be set before sound playback. |
Get Connected Playback Media | Retrieves the playback media stream pointer that was assigned to this synth component. |
Get Output Media Stats | Get statistics for an output media |
Get Output Media Id | Get the media ID of an output media |
Get Output Media Peer Id | Get the peer ID of an output media |
Resume Playback Media | Resume the specified playback media handle, re-initiating the reception of data. |
Pause Playback Media | Pause the specified playback media handle, stopping the reception of data. |