Skip to main content
Version: 2.x

Class Room

Main Room

Assembly: cs.temp.dll.dll
Declaration
public class Room : IRoom, IDisposable

Implements:
OdinNative.Wrapper.IRoom, Odin.IDisposable

Properties

EndPoint

Room server gateway endpoint

Declaration
public string EndPoint { get; }

Id

RoomId

Declaration
public ulong Id { get; }

OwnPeerId

PeerId of self

Declaration
public ulong OwnPeerId { get; }

Name

Room name

Declaration
public string Name { get; }

RoomStatus

RoomStatus

Declaration
public string RoomStatus { get; }

IsJoined

IsJoined

Declaration
public bool IsJoined { get; }

IsClosed

IsClosed

Declaration
public bool IsClosed { get; }

PositionX

Inital position of self on join

Declaration
public float PositionX { get; }

PositionY

Inital position of self on join

Declaration
public float PositionY { get; }

PositionZ

Inital position of self on join

Declaration
public float PositionZ { get; }

CryptoCipher

Crypto cipher

Declaration
public Crypto CryptoCipher { get; }

RpcWriter

Msgpack writer for RPC

Declaration
public IMsgPackWriter RpcWriter { get; set; }

RpcId

Declaration
protected uint RpcId { get; }

RpcAckActive

Toggle message type for Room.SendRpc true is request and false is notification. Currently calls to "UpdatePeer" and "SetPeerPosition" needs to be requests!

Declaration
public bool RpcAckActive { get; set; }

RpcTableThunk

Msgpack results to RPC requests

Declaration
public ConcurrentDictionary<uint, TaskCompletionSource<RpcResult>> RpcTableThunk { get; }

RoomUserData

Odin UserData helper for marshal byte arrays on Room level

Declaration
public IUserData RoomUserData { get; }

RemotePeers

Conatiner of room peers

Declaration
public ConcurrentDictionary<ulong, PeerEntity> RemotePeers { get; }

Encoders

Container of room input medias

Declaration
public ConcurrentDictionary<ushort, MediaEncoder> Encoders { get; }

Decoders

Elements of room output medias

Declaration
public IEnumerable<MediaDecoder> Decoders { get; }

Token

Room joining token

Declaration
public string Token { get; }

Parent

Default value

null
indicates root or not set

Declaration
public object Parent { get; set; }

Fields

Samplerate

Room default samplerate

Declaration
public readonly uint Samplerate

Stereo

Room default stereo flag

Declaration
public readonly bool Stereo

AvailableEncoderIds

Available media ids that are reserved for the room

Declaration
public Queue<ushort> AvailableEncoderIds

Methods

OnDatagramReceived(DatagramEventArgs)

Declaration
protected void OnDatagramReceived(DatagramEventArgs e)
Parameters
TypeName
OdinNative.Wrapper.Room.DatagramEventArgse

OnRPCReceived(RpcEventArgs)

Declaration
protected void OnRPCReceived(RpcEventArgs e)
Parameters
TypeName
OdinNative.Wrapper.Room.RpcEventArgse

Create(string, uint, bool)

Initialise independent room

Declaration
public static Room Create(string endPoint, uint samplerate = 48000, bool stereo = false)
Returns

OdinNative.Wrapper.Room.Room: Room object

Parameters
TypeNameDescription
System.StringendPointGateway server
System.UInt32sampleratesets default samplerate
System.Booleanstereosets default stereo flag

GetBaseRoom<T>()

This will always return itself

Declaration
public T GetBaseRoom<T>() where T : IRoom
Returns

<T>

Type Parameters
  • T

Room_OnPeerLeft(object, ulong)

Remove and dispose peer of OdinNative.Wrapper.Room.Room.RemotePeers

Declaration
protected virtual void Room_OnPeerLeft(object sender, ulong peerId)
Parameters
TypeName
System.Objectsender
System.UInt64peerId

Room_OnMediaStarted(object, ulong, MediaRpc)

Add new created decoder to OdinNative.Wrapper.Room.Room.RemotePeers by id

Declaration
protected virtual void Room_OnMediaStarted(object sender, ulong peerId, MediaRpc media)
Parameters
TypeName
System.Objectsender
System.UInt64peerId
Odin.MediaRpcmedia

Room_OnMediaStopped(object, ulong, ushort)

Remove and dispose decoder of OdinNative.Wrapper.Room.Room.RemotePeers by media id

Declaration
protected virtual void Room_OnMediaStopped(object sender, ulong peerId, ushort mediaId)
Parameters
TypeName
System.Objectsender
System.UInt64peerId
System.UInt16mediaId

Room_OnUserDataChanged(object, ulong, byte[])

Set userdata of OdinNative.Wrapper.Room.Room.RemotePeers by id

Declaration
protected virtual void Room_OnUserDataChanged(object sender, ulong peerId, byte[] userData)
Parameters
TypeName
System.Objectsender
System.UInt64peerId
System.Byte[]userData

Room_OnMessageReceived(object, ulong, byte[])

Log message in Debug

Declaration
protected virtual void Room_OnMessageReceived(object sender, ulong peerId, byte[] message)
Parameters
TypeName
System.Objectsender
System.UInt64peerId
System.Byte[]message

Room_OnRoomJoined(object, ulong, string, string, byte[], ushort[], ReadOnlyCollection<PeerRpc>)

Set OdinNative.Wrapper.Room.Room.RemotePeers for bookkeeping and AvailableEncoderIds for encoders

Declaration
protected virtual void Room_OnRoomJoined(object sender, ulong ownPeerId, string name, string customer, byte[] roomUserData, ushort[] mediaIds, ReadOnlyCollection<PeerRpc> peers)
Parameters
TypeName
System.Objectsender
System.UInt64ownPeerId
System.Stringname
System.Stringcustomer
System.Byte[]roomUserData
System.UInt16[]mediaIds
Odin.ReadOnlyCollection<PeerRpc>peers

Room_OnRoomLeft(object, string)

This close the current room

Declaration
protected virtual void Room_OnRoomLeft(object sender, string reason)
Parameters
TypeNameDescription
System.Objectsenderroom
System.Stringreasonevent reason

Room_OnRoomStatusChanged(object, string)

Set the RoomStatus and flag for transition

Declaration
protected virtual void Room_OnRoomStatusChanged(object sender, string connectionStatus)
Parameters
TypeName
System.Objectsender
System.StringconnectionStatus

Room_OnDatagram(object, DatagramEventArgs)

Default impl will push a datagram to all OdinNative.Wrapper.Room.Room.Decoders of the same mediaId in the current room.

Declaration
public virtual void Room_OnDatagram(object sender, DatagramEventArgs e)
Parameters
TypeNameDescription
System.ObjectsenderRoom object
OdinNative.Wrapper.Room.DatagramEventArgseDatagram payload

Room_OnRPC(object, RpcEventArgs)

Default impl will process all rpc packets.

Declaration
public virtual void Room_OnRPC(object sender, RpcEventArgs e)
Parameters
TypeNameDescription
System.ObjectsenderRoom object
OdinNative.Wrapper.Room.RpcEventArgseRPC payload

ProcessRPC(byte[])

Will process all rpc packets.

Declaration
public virtual void ProcessRPC(byte[] bytes)
Parameters
TypeNameDescription
System.Byte[]bytesraw Msgpack

Join(string, string, uint, bool, out Room)

Create and join a Room

Declaration
public static bool Join(string endPoint, string token, uint samplerate, bool stereo, out Room room)
Returns

System.Boolean: true on successfully request join or false

Parameters
TypeNameDescription
System.StringendPointGateway server
System.StringtokenJoin token
System.UInt32sampleratesets default samplerate
System.Booleanstereosets default stereo flag
OdinNative.Wrapper.Room.RoomroomInitialized room

Join(OdinConnectionPoolHandle, string, string, uint, bool, out Room)

Create and join a Room

Declaration
public static bool Join(OdinConnectionPoolHandle connectionPoolHandle, string endPoint, string token, uint samplerate, bool stereo, out Room room)
Returns

System.Boolean: true on successfully request join or false

Parameters
TypeNameDescription
Odin.OdinConnectionPoolHandleconnectionPoolHandleConnection pool for the room
System.StringendPointGateway server
System.StringtokenJoin token
System.UInt32sampleratesets default samplerate
System.Booleanstereosets default stereo flag
OdinNative.Wrapper.Room.RoomroomInitialized room

Join(OdinConnectionPoolHandle, string, string, string, byte[], float, float, float, uint, bool, out Room)

Create and join a Room

Declaration
public static bool Join(OdinConnectionPoolHandle connectionPoolHandle, string endPoint, string token, string roomName, byte[] userData, float positionX, float positionY, float positionZ, uint samplerate, bool stereo, out Room room)
Returns

System.Boolean: true on successfully request join or false

Parameters
TypeNameDescription
Odin.OdinConnectionPoolHandleconnectionPoolHandleConnection pool for the room
System.StringendPointGateway server
System.StringtokenJoin token
System.StringroomNameinitial room name
System.Byte[]userDatainitial userdata
System.SinglepositionXinitial position
System.SinglepositionYinitial position
System.SinglepositionZinitial position
System.UInt32sampleratesets default samplerate
System.Booleanstereosets default stereo flag
OdinNative.Wrapper.Room.RoomroomInitialized room

Join(string)

Join a room with token

Declaration
public bool Join(string token)
Returns

System.Boolean: true on successfully request join or false

Parameters
TypeNameDescription
System.StringtokenJoin token

Join(OdinConnectionPoolHandle, string, string, string, byte[], float, float, float, uint, bool, OdinCipherHandle)

Create and join a Room

Declaration
public static Room Join(OdinConnectionPoolHandle connectionPoolHandle, string endPoint, string token, string roomName, byte[] userData, float positionX, float positionY, float positionZ, uint samplerate, bool stereo, OdinCipherHandle cipher = null)
Returns

OdinNative.Wrapper.Room.Room: true on successfully request join or false

Parameters
TypeNameDescription
Odin.OdinConnectionPoolHandleconnectionPoolHandleConnection pool for the room
System.StringendPointGateway server
System.StringtokenJoin token
System.StringroomNameinitial room name
System.Byte[]userDatainitial userdata
System.SinglepositionXinitial position
System.SinglepositionYinitial position
System.SinglepositionZinitial position
System.UInt32sampleratesets default samplerate
System.Booleanstereosets default stereo flag
Odin.OdinCipherHandlecipher

Join(string, string, byte[], float, float, float, OdinCipherHandle)

Join a room

Declaration
public bool Join(string token, string roomName = null, byte[] userData = null, float positionX = 0, float positionY = 0, float positionZ = 0, OdinCipherHandle cipher = null)
Returns

System.Boolean: true on successfully request join or false

Parameters
TypeNameDescription
System.Stringtokenroom token
System.StringroomNameinitial room name
System.Byte[]userDatainitial userdata
System.SinglepositionXinitial position
System.SinglepositionYinitial position
System.SinglepositionZinitial position
Odin.OdinCipherHandleciphercypto interface

Join(string, OdinCipherHandle)

Join a room with encryption

Declaration
public bool Join(string token, OdinCipherHandle cipher)
Returns

System.Boolean: true on successfully request join or false

Parameters
TypeNameDescription
System.StringtokenJoin token
Odin.OdinCipherHandleciphercypto cipher

GetRoomId()

Retrieves the room id

Declaration
public ulong GetRoomId()
Returns

System.UInt64: room id### GetRoomName(bool) Retrieves the room name

Declaration
public string GetRoomName(bool update = true)
Returns

System.String: room name

Parameters
TypeNameDescription
System.Booleanupdateupdate this room name on true

ResendUserData()

Resend native UserData

Declaration
protected OdinError ResendUserData()
Returns

Odin.OdinError: error code### GetEncoder(ushort, out MediaEncoder) Get a encoder from OdinNative.Wrapper.Room.Room.Encoders by id

Declaration
public bool GetEncoder(ushort mediaId, out MediaEncoder encoder)
Returns

System.Boolean: true on encoder found or false

Parameters
TypeNameDescription
System.UInt16mediaIdid of a input media
OdinNative.Wrapper.MediaEncoderencoderinput object

GetOrCreateEncoder(ushort, out MediaEncoder)

Get a encoder from OdinNative.Wrapper.Room.Room.Encoders by id. If the encoder is not found create a new one that will be added to OdinNative.Wrapper.Room.Room.Encoders.

Declaration
public bool GetOrCreateEncoder(ushort mediaId, out MediaEncoder encoder)
Returns

System.Boolean: true or false on error

Parameters
TypeNameDescription
System.UInt16mediaIdid of a input media
OdinNative.Wrapper.MediaEncoderencoderinput object

GetOrCreateEncoder(ushort, uint, bool, out MediaEncoder)

Get a encoder from OdinNative.Wrapper.Room.Room.Encoders by id. If the encoder is not found create a new one that will be added to OdinNative.Wrapper.Room.Room.Encoders.

Declaration
public bool GetOrCreateEncoder(ushort mediaId, uint samplerate, bool stereo, out MediaEncoder encoder)
Returns

System.Boolean: true or false on error

Parameters
TypeNameDescription
System.UInt16mediaIdid of a input media
System.UInt32sampleratecustom samplerate
System.Booleanstereocustom stereo flag
OdinNative.Wrapper.MediaEncoderencoderinput object

CreateEncoder(ushort)

Create a new input media that will be added toOdinNative.Wrapper.Room.Room.Encoders

Declaration
public MediaEncoder CreateEncoder(ushort mediaId)
Returns

OdinNative.Wrapper.MediaEncoder: input media

Parameters
TypeNameDescription
System.UInt16mediaIdid of a input media

CreateEncoder(ushort, uint, bool)

Create a new input media that will be added toOdinNative.Wrapper.Room.Room.Encoders

Declaration
public MediaEncoder CreateEncoder(ushort mediaId, uint samplerate, bool stereo)
Returns

OdinNative.Wrapper.MediaEncoder: input media

Parameters
TypeNameDescription
System.UInt16mediaIdid of a input media
System.UInt32sampleratecustom samplerate
System.Booleanstereocustom stereo flag

RemoveEncoder(ushort, out MediaEncoder)

Removes the input media from OdinNative.Wrapper.Room.Room.Encoders

Declaration
public bool RemoveEncoder(ushort mediaId, out MediaEncoder encoder)
Returns

System.Boolean: true on encoder found or false

Parameters
TypeNameDescription
System.UInt16mediaIdid of a input media
OdinNative.Wrapper.MediaEncoderencoderinput media that was removed

GetDecoder(ulong, ushort, out MediaDecoder)

Get a decoder from OdinNative.Wrapper.PeerEntity.Medias of OdinNative.Wrapper.Room.Room.RemotePeers by id

Declaration
public bool GetDecoder(ulong peerId, ushort mediaId, out MediaDecoder decoder)
Returns

System.Boolean: true on decoder found or false

Parameters
TypeNameDescription
System.UInt64peerIdid of peer
System.UInt16mediaIdid of output media
OdinNative.Wrapper.MediaDecoderdecoderoutput object or null

GetOrCreateDecoder(ulong, ushort, out MediaDecoder)

Get a decoder from OdinNative.Wrapper.PeerEntity.Medias of OdinNative.Wrapper.Room.Room.RemotePeers by id. If the decoder is not found create a new one that will be added to the Peer

Declaration
public bool GetOrCreateDecoder(ulong peerId, ushort mediaId, out MediaDecoder decoder)
Returns

System.Boolean: true on decoder found or false

Parameters
TypeNameDescription
System.UInt64peerIdid of peer
System.UInt16mediaIdid of output media
OdinNative.Wrapper.MediaDecoderdecoderoutput object or null

GetOrCreateDecoder(ulong, ushort, uint, bool, out MediaDecoder)

Get a decoder from OdinNative.Wrapper.PeerEntity.Medias of OdinNative.Wrapper.Room.Room.RemotePeers by id. If the decoder is not found create a new one that will be added to the Peer

Declaration
public bool GetOrCreateDecoder(ulong peerId, ushort mediaId, uint samplerate, bool stereo, out MediaDecoder decoder)
Returns

System.Boolean: true on decoder found or false

Parameters
TypeNameDescription
System.UInt64peerIdid of peer
System.UInt16mediaIdid of output media
System.UInt32sampleratecustom samplerate
System.Booleanstereocustom stereo flag
OdinNative.Wrapper.MediaDecoderdecoderoutput object or null

CreateDecoder(ulong, ushort)

Create a new output media that will be added to OdinNative.Wrapper.PeerEntity.Medias

Declaration
public MediaDecoder CreateDecoder(ulong peerId, ushort mediaId)
Returns

OdinNative.Wrapper.MediaDecoder: output media

Parameters
TypeNameDescription
System.UInt64peerIdid of peer
System.UInt16mediaIdid of output media

CreateDecoder(ulong, ushort, uint, bool)

Create a new output media that will be added to OdinNative.Wrapper.PeerEntity.Medias

Declaration
public MediaDecoder CreateDecoder(ulong peerId, ushort mediaId, uint samplerate, bool stereo)
Returns

OdinNative.Wrapper.MediaDecoder: output media

Parameters
TypeNameDescription
System.UInt64peerIdid of peer
System.UInt16mediaIdid of output media
System.UInt32sampleratecustom samplerate
System.Booleanstereocustom stereo flag

RemoveDecoder(ulong, ushort, out MediaDecoder)

Removes a output media from a remote peer.

Declaration
public bool RemoveDecoder(ulong peerId, ushort mediaId, out MediaDecoder decoder)
Returns

System.Boolean: true on decoder found or false

Parameters
TypeNameDescription
System.UInt64peerIdid of peer
System.UInt16mediaIdid of a output media
OdinNative.Wrapper.MediaDecoderdecoderoutput media that was removed

StartMedia(MediaEncoder)

Send a "StartMedia" RPC to the server to start the encoder for input.

Declaration
public virtual Task<RpcResult> StartMedia(MediaEncoder encoder)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
OdinNative.Wrapper.MediaEncoderencoderinput media

StartMedia(ushort, MediaRpcProperties)

Send a "StartMedia" RPC with custom media-data to the server to start the encoder for input.

Declaration
public virtual Task<RpcResult> StartMedia(ushort mediaId, MediaRpcProperties properties)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
System.UInt16mediaIdid of input media
Odin.MediaRpcPropertiespropertiesarbitrary media data usually to identify the media on lost connections

StopMedia(MediaEncoder)

Send a "StopMedia" to the server to stop the encoder.

Declaration
public virtual Task<RpcResult> StopMedia(MediaEncoder encoder)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
OdinNative.Wrapper.MediaEncoderencoderinput media to stop

StopMedia(ushort)

Send a "StopMedia" to the server to stop the encoder.

Declaration
public virtual Task<RpcResult> StopMedia(ushort mediaId)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
System.UInt16mediaIdraw id to stop

PauseMedia(MediaDecoder)

Send a "PauseMedia" to the server to stop the decoder for output.

Declaration
public virtual Task<RpcResult> PauseMedia(MediaDecoder decoder)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
OdinNative.Wrapper.MediaDecoderdecoderoutput media to stop

PauseMedia(ushort)

Send a "PauseMedia" to the server to stop the decoder for output.

Declaration
public virtual Task<RpcResult> PauseMedia(ushort mediaId)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
System.UInt16mediaIdraw id to stop

ResumeMedia(MediaDecoder)

Send a "ResumeMedia" to the server to start a stopped decoder for output.

Declaration
public virtual Task<RpcResult> ResumeMedia(MediaDecoder decoder)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
OdinNative.Wrapper.MediaDecoderdecoderoutput media to start

ResumeMedia(ushort)

Send a "ResumeMedia" to the server to start a stopped decoder for output.

Declaration
public virtual Task<RpcResult> ResumeMedia(ushort mediaId)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
System.UInt16mediaIdraw id to start

UpdateUserData(IUserData)

Update arbitrary userdata of self (note: OdinNative.Wrapper.UserData)

Declaration
public virtual Task<RpcResult> UpdateUserData(IUserData userData)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
OdinNative.Wrapper.IUserDatauserDataarbitrary data

UpdateUserData(byte[])

Update binary userdata of self (note: OdinNative.Wrapper.Room.Room.UpdateUserData(OdinNative.Wrapper.IUserData))

Declaration
public virtual Task<RpcResult> UpdateUserData(byte[] bytes)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
System.Byte[]bytesraw binary data

SetPosition(float, float, float)

Set the spatial position for server side culling. Other remote peers outside the boundary will appear as not in the room or leaving the room.

Declaration
public virtual Task<RpcResult> SetPosition(float x = 0, float y = 0, float z = 0)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
System.SinglexX of vector
System.SingleyY of vector
System.SinglezZ of vector

SendMessage(string)

Send "SendMessage" to the server to broadcast the message with default UTF8 encoding.

Declaration
public virtual Task<RpcResult> SendMessage(string message)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
System.StringmessageUTF8 string

SendMessage(string, Encoding)

Send "SendMessage" to the server to broadcast the message.

Declaration
public virtual Task<RpcResult> SendMessage(string message, Encoding encoding)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
System.Stringmessagestring
Odin.Encodingencodingcustom encoding

SendMessage(byte[])

Send "SendMessage" to the server to broadcast an arbitrary message.

Declaration
public virtual Task<RpcResult> SendMessage(byte[] message)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
System.Byte[]messagearbitrary data

SendRpc(string, Action<IMsgPackWriter>)

Send registered RPCs to the server. (set by OdinNative.Wrapper.Room.Room.RpcWriter)

Declaration
public virtual Task<RpcResult> SendRpc(string method, Action<IMsgPackWriter> builder)
Returns

Odin.Task<OdinNative.Wrapper.Room.RpcResult>: Thunk task that will not run (see OdinNative.Wrapper.Room.Room.RpcTableThunk)

Parameters
TypeNameDescription
System.StringmethodRPC method
Odin.Action<IMsgPackWriter>builderMsgpack builder

SendAudio(float[], bool)

Push the samples to all OdinNative.Wrapper.Room.Room.Encoders for pipeline processing and pop the result as datagrams to the server

Declaration
public virtual void SendAudio(float[] samples, bool isSilent = false)
Parameters
TypeNameDescription
System.Single[]samplesAudio data
System.BooleanisSilentflag these samples as silence

SendAudio(float[], ushort, bool)

Push the samples to the input media for pipeline processing and pop the result as datagram to the server

Declaration
public virtual bool SendAudio(float[] samples, ushort mediaId, bool isSilent = false)
Returns

System.Boolean: true on success or false

Parameters
TypeNameDescription
System.Single[]samplesAudio data
System.UInt16mediaIdinput media id
System.BooleanisSilentflag these samples as silence

SendAudio(float[], MediaEncoder)

Push the samples to the input media for pipeline processing and pop the result as datagram to the server

Declaration
public virtual bool SendAudio(float[] samples, MediaEncoder encoder)
Returns

System.Boolean: true on success or false

Parameters
TypeNameDescription
System.Single[]samplesAudio data
OdinNative.Wrapper.MediaEncoderencoderinput media

SendEncoderAudio(ushort)

Pop all samples from the input media by id and send them to the server

Declaration
public virtual bool SendEncoderAudio(ushort mediaId)
Returns

System.Boolean: true on success or false

Parameters
TypeNameDescription
System.UInt16mediaIdinput media id

SendEncoderAudio(MediaEncoder)

Pop all samples from the input media and send them to the server

Declaration
public virtual bool SendEncoderAudio(MediaEncoder encoder)
Returns

System.Boolean: true on success or false

Parameters
TypeNameDescription
OdinNative.Wrapper.MediaEncoderencoderinput media

SendDatagram(ushort, byte[])

Send audio to the server

Declaration
protected virtual OdinError SendDatagram(ushort mediaId, byte[] datagram)
Returns

Odin.OdinError: OdinNative.Core.Imports.NativeBindings.OdinError.ODIN_ERROR_SUCCESS or error

Parameters
TypeNameDescription
System.UInt16mediaIdinput media id
System.Byte[]datagramencoder datagram

SendLoopbackRpc(byte[])

Send client side rpc message

Declaration
protected virtual OdinError SendLoopbackRpc(byte[] rpc)
Returns

Odin.OdinError: OdinNative.Core.Imports.NativeBindings.OdinError.ODIN_ERROR_SUCCESS or error

Parameters
TypeNameDescription
System.Byte[]rpcbytes

Close()

Close the native room. (native dispose)

Declaration
public void Close()

Dispose(bool)

On dispose will free the room and all associated data

Declaration
protected virtual void Dispose(bool disposing)
Parameters
TypeName
System.Booleandisposing

~Room()

Default deconstructor

Declaration
protected ~Room()

Dispose()

On dispose will free the room and all associated data

Declaration
public void Dispose()

Events

OnDatagram

Call on audio data

Declaration
public event EventHandler<DatagramEventArgs> OnDatagram
Event Type

Odin.EventHandler<OdinNative.Wrapper.Room.DatagramEventArgs>

OnRpc

Call on rpc data

Declaration
public event EventHandler<RpcEventArgs> OnRpc
Event Type

Odin.EventHandler<OdinNative.Wrapper.Room.RpcEventArgs>

OnSendRpcResponse

Call on response to a rpc request

Declaration
public event EventHandler<RpcResult> OnSendRpcResponse
Event Type

Odin.EventHandler<OdinNative.Wrapper.Room.RpcResult>

OnRoomStatusChanged

Odin connection status

Declaration
public event OnRoomStatusChangedDelegate OnRoomStatusChanged
Event Type

OdinNative.Wrapper.OnRoomStatusChangedDelegate

OnRoomJoined

Odin room joined

Declaration
public event OnRoomJoinedDelegate OnRoomJoined
Event Type

OdinNative.Wrapper.OnRoomJoinedDelegate

OnRoomLeft

Odin room left

Declaration
public event OnRoomLeftDelegate OnRoomLeft
Event Type

OdinNative.Wrapper.OnRoomLeftDelegate

OnPeerJoined

Odin peer joined

Declaration
public event OnPeerJoinedDelegate OnPeerJoined
Event Type

OdinNative.Wrapper.OnPeerJoinedDelegate

OnPeerLeft

Odin peer left

Declaration
public event OnPeerLeftDelegate OnPeerLeft
Event Type

OdinNative.Wrapper.OnPeerLeftDelegate

OnMediaStarted

Odin media started

Declaration
public event OnMediaStartedDelegate OnMediaStarted
Event Type

OdinNative.Wrapper.OnMediaStartedDelegate

OnMediaStopped

Odin media stopped

Declaration
public event OnMediaStoppedDelegate OnMediaStopped
Event Type

OdinNative.Wrapper.OnMediaStoppedDelegate

OnUserDataChanged

Odin peer changed userdata

Declaration
public event OnUserDataChangedDelegate OnUserDataChanged
Event Type

OdinNative.Wrapper.OnUserDataChangedDelegate

OnMessageReceived

Odin room received message

Declaration
public event OnMessageReceivedDelegate OnMessageReceived
Event Type

OdinNative.Wrapper.OnMessageReceivedDelegate

Implements