docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IChannelSession

    A connection to a channel.

    Inherited Members
    IKeyedItemNotifyPropertyChanged<ChannelId>.Key
    INotifyPropertyChanged.PropertyChanged
    Namespace: VivoxUnity
    Assembly: VivoxUnity.dll
    Syntax
    public interface IChannelSession : IKeyedItemNotifyPropertyChanged<ChannelId>, INotifyPropertyChanged

    Properties

    AudioState

    The state of the audio portion of this channel session.

    Declaration
    ConnectionState AudioState { get; }
    Property Value
    Type Description
    ConnectionState
    Remarks

    Changes to this value can occur at any time due to network or moderator events.

    Channel

    The channel ID of this session.

    Declaration
    ChannelId Channel { get; }
    Property Value
    Type Description
    ChannelId

    ChannelState

    The state of the overall connection to this channel session.

    Declaration
    ConnectionState ChannelState { get; }
    Property Value
    Type Description
    ConnectionState
    Remarks

    Changes to this value can occur at any time due to network or moderator events.

    IsSessionBeingTranscribed

    Indicates that this session is being transcribed.

    Declaration
    bool IsSessionBeingTranscribed { get; }
    Property Value
    Type Description
    bool
    Remarks

    To set this value, use BeginSetChannelTranscription(bool, string, AsyncCallback).

    IsTransmitting

    Indicates that microphone audio and injected audio will transmit to this session.

    Declaration
    bool IsTransmitting { get; }
    Property Value
    Type Description
    bool
    Remarks

    Setting this value to true clears this value from all other sessions.

    MessageLog

    The list of incoming messages.

    Declaration
    IReadOnlyQueue<IChannelTextMessage> MessageLog { get; }
    Property Value
    Type Description
    IReadOnlyQueue<IChannelTextMessage>
    Remarks

    Use IReadOnlyQueue events to get notifications of incoming text messages.

    Parent

    The login session that owns this channel session.

    Declaration
    ILoginSession Parent { get; }
    Property Value
    Type Description
    ILoginSession

    Participants

    The list of participants in this channel, including the current user.

    Declaration
    IReadOnlyDictionary<string, IParticipant> Participants { get; }
    Property Value
    Type Description
    IReadOnlyDictionary<string, IParticipant>
    Remarks

    Use IReadOnlyDictionary events to get participant notifications, such as when participants are joining, leaving, or speaking.

    SessionArchive

    The list of session archive messages returned by a BeginSessionArchiveQuery.

    Declaration
    [Obsolete("This feature is being deprecated in favor of the limited beta release of Chat History. Please contact Unity Support for feature enablement.")]
    IReadOnlyQueue<ISessionArchiveMessage> SessionArchive { get; }
    Property Value
    Type Description
    IReadOnlyQueue<ISessionArchiveMessage>
    Remarks

    Use IReadOnlyQueue events to get notifications of incoming messages from a session archive query. Note that this is not automatically cleared when starting a new BeginSessionArchiveQuery.

    SessionArchiveResult

    The result set when all messages have been returned from a BeginSessionArchiveQuery.

    Declaration
    [Obsolete("This feature is being deprecated in favor of the limited beta release of Chat History. Please contact Unity Support for feature enablement.")]
    IArchiveQueryResult SessionArchiveResult { get; }
    Property Value
    Type Description
    IArchiveQueryResult
    Remarks

    Use the PropertyChanged event to get notified when a session archive query has started or completed.

    SessionHandle

    A handle for the channel session.

    Declaration
    string SessionHandle { get; }
    Property Value
    Type Description
    string

    TextState

    The state of the text portion of this channel session.

    Declaration
    ConnectionState TextState { get; }
    Property Value
    Type Description
    ConnectionState
    Remarks

    Changes to this value can occur at any time due to network or moderator events.

    TranscribedLog

    The list of incoming transcribed messages.

    Declaration
    IReadOnlyQueue<ITranscribedMessage> TranscribedLog { get; }
    Property Value
    Type Description
    IReadOnlyQueue<ITranscribedMessage>
    Remarks

    Use IReadOnlyQueue events to get notifications of incoming transcribed messages.

    Methods

    BeginConnect(bool, bool, bool, string, AsyncCallback)

    Perform the initial connection to the channel.

    Declaration
    IAsyncResult BeginConnect(bool connectAudio, bool connectText, bool switchTransmission, string accessToken, AsyncCallback callback)
    Parameters
    Type Name Description
    bool connectAudio

    True to connect audio.

    bool connectText

    True to connect text.

    bool switchTransmission

    Whether to transmit in this channel. Transmitting in one channel stops transmitting in other channels.

    string accessToken

    The access token that grants the user access to the channel.

    AsyncCallback callback

    A delegate to call when this operation completes.

    Returns
    Type Description
    IAsyncResult

    The AsyncResult.

    Remarks

    Developers of games that do not have secure communications requirements can use GetConnectToken(TimeSpan?) to generate the required access token.

    BeginSendText(string, AsyncCallback)

    Send a message to this channel.

    Declaration
    IAsyncResult BeginSendText(string message, AsyncCallback callback)
    Parameters
    Type Name Description
    string message

    The body of the message.

    AsyncCallback callback

    A delegate to call when this operation completes.

    Returns
    Type Description
    IAsyncResult

    The AsyncResult.

    BeginSendText(string, string, string, string, AsyncCallback)

    Send a message to this channel.

    Declaration
    IAsyncResult BeginSendText(string language, string message, string applicationStanzaNamespace, string applicationStanzaBody, AsyncCallback callback)
    Parameters
    Type Name Description
    string language

    The language of the message, for example, "en". This can be null to use the default language ("en" for most systems). This must conform to RFC 5646.

    string message

    The body of the message.

    string applicationStanzaNamespace

    An optional namespace element for additional application data.

    string applicationStanzaBody

    The additional application data body.

    AsyncCallback callback

    A delegate to call when this operation completes.

    Returns
    Type Description
    IAsyncResult

    The AsyncResult.

    BeginSessionArchiveQuery(DateTime?, DateTime?, string, AccountId, uint, string, string, int, AsyncCallback)

    Start a query of archived channel messages.

    Declaration
    [Obsolete("This feature is being deprecated in favor of the limited beta release of Chat History. Please contact Unity Support for feature enablement.")]
    IAsyncResult BeginSessionArchiveQuery(DateTime? timeStart, DateTime? timeEnd, string searchText, AccountId userId, uint max, string afterId, string beforeId, int firstMessageIndex, AsyncCallback callback)
    Parameters
    Type Name Description
    DateTime? timeStart

    Results filtering: Only messages on or after the given date/time are returned. For no start limit, use null.

    DateTime? timeEnd

    Results filtering: Only messages before the given date/time are returned. For no end limit, use null.

    string searchText

    Results filtering: Only messages that contain the specified text are returned. For order matching, use double-quotes around the search terms. For no text filtering, use null.

    AccountId userId

    Results filtering: Only messages to/from the specified participant are returned. For no participant filtering, use null.

    uint max

    Results paging: The maximum number of messages to return (up to 50). If more than 50 messages are needed, then you must perform multiple queries. Use 0 to get the total message count without retrieving them.

    string afterId

    Results paging: Only messages following the specified message ID are returned in the result set. If this parameter is set, beforeId must be null. For no lower limit, use null.

    string beforeId

    Results paging: Only messages preceding the specified message ID are returned in the result set. If this parameter is set, afterId must be null. For no upper limit, use null.

    int firstMessageIndex

    Results paging: The server-side index (not message ID) of the first message to retrieve. The first message in the result set always has an index of 0. For no starting message, use -1.

    AsyncCallback callback

    A delegate to call when this operation completes.

    Returns
    Type Description
    IAsyncResult

    The AsyncResult.

    Exceptions
    Type Condition
    ArgumentException

    Thrown when the maximum value is too large.

    ArgumentException

    Thrown when afterId and beforeId are used at the same time.

    BeginSetAudioConnected(bool, bool, AsyncCallback)

    Add or remove audio from the channel session.

    Declaration
    IAsyncResult BeginSetAudioConnected(bool value, bool switchTransmission, AsyncCallback callback)
    Parameters
    Type Name Description
    bool value

    True to add audio, false to remove audio.

    bool switchTransmission
    AsyncCallback callback

    A delegate to call when this operation completes.

    Returns
    Type Description
    IAsyncResult

    The AsyncResult.

    BeginSetChannelTranscription(bool, string, AsyncCallback)

    Issue a request to set transcription for this channel session.

    Declaration
    IAsyncResult BeginSetChannelTranscription(bool value, string accessToken, AsyncCallback callback)
    Parameters
    Type Name Description
    bool value

    True to enable transcription, false to disable transcription.

    string accessToken

    The access token that grants the user access to set transciption on the channel. For testing purposes, use GetTranscriptionToken(TimeSpan?).

    AsyncCallback callback

    A delegate to call when this operation completes.

    Returns
    Type Description
    IAsyncResult

    BeginSetTextConnected(bool, AsyncCallback)

    Add or remove text from the channel session.

    Declaration
    IAsyncResult BeginSetTextConnected(bool value, AsyncCallback callback)
    Parameters
    Type Name Description
    bool value

    True to add text, false to remove text.

    AsyncCallback callback

    A delegate to call when this operation completes.

    Returns
    Type Description
    IAsyncResult

    The AsyncResult.

    ConnectAsync(bool, bool, bool, TimeSpan?, AsyncCallback, string)

    Perform the initial connection to the channel.

    Declaration
    Task ConnectAsync(bool connectAudio, bool connectText, bool switchTransmission, TimeSpan? expiration = null, AsyncCallback callback = null, string accessToken = null)
    Parameters
    Type Name Description
    bool connectAudio

    True to connect audio.

    bool connectText

    True to connect text.

    bool switchTransmission

    Whether to transmit in this channel. Transmitting in one channel stops transmitting in other channels.

    TimeSpan? expiration

    Sets the expiration for the token this request generates. Defaults to 90 seconds from the current time.

    AsyncCallback callback

    A delegate to call when this operation completes.

    string accessToken

    The access token that grants the user access to the channel. If not provided, a debug token will automatically be created for the developer.

    Returns
    Type Description
    Task

    Disconnect(AsyncCallback)

    Disconnect the user from this channel.

    Declaration
    IAsyncResult Disconnect(AsyncCallback callback = null)
    Parameters
    Type Name Description
    AsyncCallback callback
    Returns
    Type Description
    IAsyncResult
    Remarks
    A delegate to call when this operation completes. The AsyncResult. The AudioState and TextState properties are not set to ConnectionState.Disconnected until it is OK to rejoin this channel. The Application must monitor property changes for these properties to determine when it is OK to rejoin the channel. This object remains in the ILoginSession.ChannelSessions list. Use ILoginSession.DeleteChannelSession to remove it from the list.

    EndConnect(IAsyncResult)

    The consumer of this class should call this when BeginConnect() completes.

    Declaration
    void EndConnect(IAsyncResult result)
    Parameters
    Type Name Description
    IAsyncResult result

    The IAsyncResult object returned from BeginConnect() or provided to the callback delegate.

    EndSendText(IAsyncResult)

    The consumer of this class should call this when BeginSendText() completes.

    Declaration
    void EndSendText(IAsyncResult result)
    Parameters
    Type Name Description
    IAsyncResult result

    The IAsyncResult object returned from BeginSendText() or provided to the callback delegate.

    EndSessionArchiveQuery(IAsyncResult)

    The consumer of this class should call this when BeginSessionArchiveQuery() completes.

    Declaration
    [Obsolete("This feature is being deprecated in favor of the limited beta release of Chat History. Please contact Unity Support for feature enablement.")]
    void EndSessionArchiveQuery(IAsyncResult result)
    Parameters
    Type Name Description
    IAsyncResult result

    The IAsyncResult object returned from BeginSessionArchiveQuery() or provided to the callback delegate.

    EndSetAudioConnected(IAsyncResult)

    The consumer of this class should call this when BeginSetAudioConnected() completes.

    Declaration
    void EndSetAudioConnected(IAsyncResult result)
    Parameters
    Type Name Description
    IAsyncResult result

    The IAsyncResult object returned from BeginSetAudioConnected() or provided to the callback delegate.

    EndSetChannelTranscription(IAsyncResult)

    The consumer of this class should call this when BeginSetChannelTranscription() completes.

    Declaration
    void EndSetChannelTranscription(IAsyncResult result)
    Parameters
    Type Name Description
    IAsyncResult result

    The IAsyncResult object returned from BeginSetChannelTranscription() or provided to the callback delegate.

    EndSetTextConnected(IAsyncResult)

    The consumer of this class should call this when BeginSetTextConnected() completes.

    Declaration
    void EndSetTextConnected(IAsyncResult result)
    Parameters
    Type Name Description
    IAsyncResult result

    The IAsyncResult object returned from BeginSetTextConnected() or provided to the callback delegate.

    GetConnectToken(TimeSpan?)

    Get a token that can be used to connect to this channel.

    Declaration
    string GetConnectToken(TimeSpan? tokenExpirationDuration = null)
    Parameters
    Type Name Description
    TimeSpan? tokenExpirationDuration

    The length of time the token is valid for.

    Returns
    Type Description
    string

    A token that can be used to join this channel.

    Remarks

    To be used only by applications without secure communications requirements.

    GetConnectToken(string, TimeSpan)

    Get a token that can be used to connect to this channel.

    Declaration
    string GetConnectToken(string tokenSigningKey, TimeSpan tokenExpirationDuration)
    Parameters
    Type Name Description
    string tokenSigningKey

    The key corresponding to the issuer for this account that is used to sign the token.

    TimeSpan tokenExpirationDuration

    The length of time the token is valid for.

    Returns
    Type Description
    string

    A token that can be used to join this channel.

    Remarks

    To be used only by applications without secure communications requirements.

    GetTranscriptionToken(TimeSpan?)

    Get a token that can be used to set transcriptions in this channel.

    Declaration
    string GetTranscriptionToken(TimeSpan? tokenExpirationDuration = null)
    Parameters
    Type Name Description
    TimeSpan? tokenExpirationDuration

    The length of time the token is valid for.

    Returns
    Type Description
    string

    A token that can be used to set channel transcription.

    Remarks

    To be used only by applications without secure communications requirements.

    GetTranscriptionToken(string, TimeSpan)

    Get a token that can be used to set transcriptions in this channel.

    Declaration
    string GetTranscriptionToken(string tokenSigningKey, TimeSpan tokenExpirationDuration)
    Parameters
    Type Name Description
    string tokenSigningKey

    The key that corresponds to the issuer for this account that is used to sign the token.

    TimeSpan tokenExpirationDuration

    The length of time the token is valid for.

    Returns
    Type Description
    string

    A token that can be used to set channel transcription.

    Remarks

    To be used only by applications without secure communications requirements.

    Set3DPosition(Vector3, Vector3, Vector3, Vector3)

    Issue a request to set the listening and speaking positions of a user in a positional channel.

    Declaration
    void Set3DPosition(Vector3 speakerPos, Vector3 listenerPos, Vector3 listenerAtOrient, Vector3 listenerUpOrient)
    Parameters
    Type Name Description
    Vector3 speakerPos

    The position of the virtual "mouth."

    Vector3 listenerPos

    The position of the virtual "ear."

    Vector3 listenerAtOrient

    A unit vector that represents the forward (Z) direction, or heading, of the listener.

    Vector3 listenerUpOrient

    A unit vector that represents the up (Y) direction of the listener. Use Vector3(0, 1, 0) for a "global" up in the world space.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)