IChannelSession
Reference the IChannelSession interface for managing voice and text in channels.
Read time 8 minutesLast updated 2 days ago
A connection to a channel.
#include <IChannelSession.h>Public Types
Name | |
|---|---|
| typedef FDelegateBeginConnectCompleted::FDelegate | FOnBeginConnectCompletedDelegate The delegate called when |
| typedef FDelegateBeginSetAudioConnectedCompleted::FDelegate | FOnBeginSetAudioConnectedCompletedDelegate The delegate called when |
| typedef FDelegateBeginSetTextConnectedCompleted::FDelegate | FOnBeginSetTextConnectedCompletedDelegate The delegate called when |
| typedef FDelegateBeginSendTextCompleted::FDelegate | FOnBeginSendTextCompletedDelegate The delegate called when |
| typedef FDelegateBeginSetChannelTranscriptionCompleted::FDelegate | FOnBeginSetChannelTranscriptionCompletedDelegate The delegate called when |
Public Functions
Name | |
|---|---|
| virtual ILoginSession & | Parent() =0 The login session that owns this channel session. |
| virtual ConnectionState | AudioState() const =0 The state of the audio portion of this channel session. |
| virtual ConnectionState | TextState() const =0 The state of the text portion of this channel session. |
| virtual ConnectionState | ChannelState() const =0 The state of the overall connection of this channel session. |
| virtual const TMap< FString, IParticipant * > & | Participants() const =0 The list of participants in this channel, including the current user. |
| virtual bool | Typing() const =0 Indicates if this user is typing. |
| virtual void | SetTyping(bool value) =0 Set whether this user is typing. Setting or clearing this causes |
| virtual bool | IsTransmitting() const =0 Indicates that microphone audio and injected audio will transmit to this session. |
| virtual ChannelId | Channel() const =0 The channel ID of this session. |
| virtual VivoxCoreError | BeginConnect(bool connectAudio, bool connectText, bool switchTransmission, const FString & accessToken, FOnBeginConnectCompletedDelegate theDelegate =FOnBeginConnectCompletedDelegate()) =0 Perform the initial connection to the channel. |
| virtual void | Disconnect(bool deleteOnDisconnect =false) =0 Disconnect the user from this channel. |
| virtual VivoxCoreError | BeginSetAudioConnected(bool value, bool switchTransmission, FOnBeginSetAudioConnectedCompletedDelegate callback =FOnBeginSetAudioConnectedCompletedDelegate()) =0 Add or remove audio from the channel session. |
| virtual VivoxCoreError | BeginSetTextConnected(bool value, FOnBeginSetTextConnectedCompletedDelegate callback =FOnBeginSetTextConnectedCompletedDelegate()) =0 Add or remove text from the channel session. |
| virtual VivoxCoreError | BeginSendText(const FString & language, const FString & message, const FString & applicationStanzaNamespace =FString(), const FString & applicationStanzaBody =FString(), FOnBeginSendTextCompletedDelegate theDelegate =FOnBeginSendTextCompletedDelegate()) =0 Send a message to this channel. |
| virtual VivoxCoreError | BeginSendText(const FString & message, FOnBeginSendTextCompletedDelegate theDelegate =FOnBeginSendTextCompletedDelegate()) =0 Send a message to this channel. |
| virtual VivoxCoreError | Set3DPosition(const FVector & speakerPosition, const FVector & listenerPosition, const FVector & listenerForwardVector, const FVector & listenerUpVector) =0 Set the 3D position of the speaker, and the position and orientation of the listener. |
| virtual FString | GetConnectToken(const FString & tokenSigningKey, FTimespan tokenExpirationDuration) const =0 Get a token that can be used to connect to this channel. |
| virtual bool | IsSessionBeingTranscribed() const =0 Indicates that this session is being transcibed. |
| virtual VivoxCoreError | BeginSetChannelTranscription(bool value, const FString & accessToken, FOnBeginSetChannelTranscriptionCompletedDelegate callback =FOnBeginSetChannelTranscriptionCompletedDelegate()) =0 Enable or disable transcription for this channel session. |
| virtual FString | GetTranscriptionToken(const FString & tokenSigningKey, FTimespan tokenExpirationDuration) const =0 Get a token that can be used to enable or disable transcription for this channel. |
Public Attributes
Name | |
|---|---|
| AudioStateChanged | EventAudioStateChanged This event fires when the audio state changes. |
| TextStateChanged | EventTextStateChanged This event fires when the text state changes. |
| ChannelStateChanged | EventChannelStateChanged This event fires when the channel connection state changes. |
| AfterParticipantAdded | EventAfterParticipantAdded This event is raised after a participant is added to the |
| BeforeParticipantRemoved | EventBeforeParticipantRemoved This event is raised before a participant is removed from the |
| AfterParticipantUpdated | EventAfterParticipantUpdated This event is raised after a participant property changes. |
| TextMessageReceived | EventTextMessageReceived An event that indicates another player has sent the channel a text message. |
| TranscribedMessageReceived | EventTranscribedMessageReceived An event that indicates incoming transcribed text from a participant in a channel session. |
Public Types Documentation
typedef FOnBeginConnectCompletedDelegate
The delegate called whentypedef FDelegateBeginConnectCompleted::FDelegate IChannelSession::FOnBeginConnectCompletedDelegate;
BeginConnect()typedef FOnBeginSetAudioConnectedCompletedDelegate
The delegate called whentypedef FDelegateBeginSetAudioConnectedCompleted::FDelegate IChannelSession::FOnBeginSetAudioConnectedCompletedDelegate;
BeginSetAudioConnected()typedef FOnBeginSetTextConnectedCompletedDelegate
The delegate called when BeginSetTextConnected()` completes.typedef FDelegateBeginSetTextConnectedCompleted::FDelegate IChannelSession::FOnBeginSetTextConnectedCompletedDelegate;
typedef FOnBeginSendTextCompletedDelegate
The delegate called whentypedef FDelegateBeginSendTextCompleted::FDelegate IChannelSession::FOnBeginSendTextCompletedDelegate;
BeginSendText()typedef FOnBeginSetChannelTranscriptionCompletedDelegate
The delegate called whentypedef FDelegateBeginSetChannelTranscriptionCompleted::FDelegate IChannelSession::FOnBeginSetChannelTranscriptionCompletedDelegate;
BeginSetChannelTranscription()Public Functions Documentation
function Parent
The login session that owns this channel session.virtual ILoginSession & Parent() =0
function AudioState
The state of the audio portion of this channel session. Remark: Changes to this value can occur at any time due to network or moderator events.virtual ConnectionState AudioState() const =0
function TextState
The state of the text portion of this channel session. Remark: Changes to this value can occur at any time due to network or moderator events.virtual ConnectionState TextState() const =0
function ChannelState
The state of the overall connection of this channel session. Remark: Changes to this value can occur at any time due to network or moderator events. It is not safe to join this user to another channel or to rejoin this channel while this property is in the ConnectionState::Disconnecting state, unless anothervirtual ConnectionState ChannelState() const =0
IChannelSessionfunction Participants
The list of participants in this channel, including the current user. Remark: Changes to this list can occur at any time. Key equals the participant's AccountId::Name().virtual const TMap< FString, IParticipant * > & Participants() const =0
function Typing
Indicates if this user is typing.virtual bool Typing() const =0
function SetTyping
Set whether this user is typing. Setting or clearing this causesvirtual void SetTyping( bool value) =0
IParticipantProperties.IsTyping()function IsTransmitting
Indicates that microphone audio and injected audio will transmit to this session. See: ILoginSession::SetTransmissionMode()virtual bool IsTransmitting() const =0
function Channel
The channel ID of this session.virtual ChannelId Channel() const =0
function BeginConnect
Perform the initial connection to the channel. Parameters:virtual VivoxCoreError BeginConnect( bool connectAudio, bool connectText, bool switchTransmission, const FString & accessToken, FOnBeginConnectCompletedDelegate theDelegate =FOnBeginConnectCompletedDelegate()) =0
- connectAudio True to connect audio.
- connectText True to connect text.
- switchTransmission When connected, transmit only into this channel. This overrides and changes the TransmissionMode set in ILoginSession.
- accessToken The access token that grants the user access to the channel.
- theDelegate A delegate to call when this operation completes.
- accessToken is empty
- connectAudio and connectText are both false
- Channel().IsValid() is false
function Disconnect
Disconnect the user from this channel. Parameters:virtual void Disconnect( bool deleteOnDisconnect =false) =0
- deleteOnDisconnect Set to true to cause the channel to be removed from ILoginSession::ChannelSessions() immediately after sending out the EventChannelStateChanged event to disconnected.
IChannelSessionfunction BeginSetAudioConnected
Add or remove audio from the channel session. Parameters:virtual VivoxCoreError BeginSetAudioConnected( bool value, bool switchTransmission, FOnBeginSetAudioConnectedCompletedDelegate callback =FOnBeginSetAudioConnectedCompletedDelegate()) =0
- value True to add audio, false to remove audio.
- switchTransmission When audio is added, transmit only into this channel. This overrides and changes the TransmissionMode set in ILoginSession.
- callback A delegate to call when this operation completes.
function BeginSetTextConnected
Add or remove text from the channel session. Parameters:virtual VivoxCoreError BeginSetTextConnected( bool value, FOnBeginSetTextConnectedCompletedDelegate callback =FOnBeginSetTextConnectedCompletedDelegate()) =0
- value True to add text, false to remove text.
- callback A delegate to call when this operation completes.
function BeginSendText
Send a message to this channel. Parameters:virtual VivoxCoreError BeginSendText( const FString & language, const FString & message, const FString & applicationStanzaNamespace =FString(), const FString & applicationStanzaBody =FString(), FOnBeginSendTextCompletedDelegate theDelegate =FOnBeginSendTextCompletedDelegate()) =0
- language The language of the message, for example, "en". To use the default language ("en" for most systems), set this to null. Note: This must conform to BCP 47 (https://tools.ietf.org/html/bcp47).
- message The body of the message.
- applicationStanzaNamespace An optional namespace element for additional application data.
- applicationStanzaBody The additional application data body.
- theDelegate A delegate to call when this operation completes.
function BeginSendText
Send a message to this channel. Parameters:virtual VivoxCoreError BeginSendText( const FString & message, FOnBeginSendTextCompletedDelegate theDelegate =FOnBeginSendTextCompletedDelegate()) =0
- message The body of the message.
- theDelegate A delegate to call when this operation completes.
function Set3DPosition
Set the 3D position of the speaker, and the position and orientation of the listener. Parameters:virtual VivoxCoreError Set3DPosition( const FVector & speakerPosition, const FVector & listenerPosition, const FVector & listenerForwardVector, const FVector & listenerUpVector) =0
- speakerPosition The position of the virtual "mouth".
- listenerPosition The position of the virtual "ear".
- listenerForwardVector A unit vector that represents the forward (X) direction, or heading, of the listener.
- listenerUpVector A unit vector that represents the up (Z) direction of the listener. Use FVector(0, 0, 1) for a "global" up in world space.
IChannelSession()function GetConnectToken
Get a token that can be used to connect to this channel. Parameters:virtual FString GetConnectToken( const FString & tokenSigningKey, FTimespan tokenExpirationDuration) const =0
- tokenSigningKey The key that corresponds to the issuer for this account that is used to sign the token.
- tokenExpirationDuration The length of time the token is valid for.
function IsSessionBeingTranscribed
Indicates that this session is being transcibed. Remark: To set this value, use BeginSetChannelTranscription().virtual bool IsSessionBeingTranscribed() const =0
function BeginSetChannelTranscription
Enable or disable transcription for this channel session. Parameters:virtual VivoxCoreError BeginSetChannelTranscription( bool value, const FString & accessToken, FOnBeginSetChannelTranscriptionCompletedDelegate callback =FOnBeginSetChannelTranscriptionCompletedDelegate()) =0
- value True to enable channel transcription, false to disable transcription.
- accessToken The access token that grants the user access to set transciption for the channel.
- callback A delegate to call when this operation completes.
function GetTranscriptionToken
Get a token that can be used to enable or disable transcription for this channel. Parameters:virtual FString GetTranscriptionToken( const FString & tokenSigningKey, FTimespan tokenExpirationDuration) const =0
- tokenSigningKey The key that corresponds to the issuer for this account that is used to sign the token.
- tokenExpirationDuration The length of time the token is valid for.
Public Attributes Documentation
variable EventAudioStateChanged
This event fires when the audio state changes.AudioStateChanged EventAudioStateChanged;
variable EventTextStateChanged
This event fires when the text state changes.TextStateChanged EventTextStateChanged;
variable EventChannelStateChanged
This event fires when the channel connection state changes.ChannelStateChanged EventChannelStateChanged;
variable EventAfterParticipantAdded
This event is raised after a participant is added to theAfterParticipantAdded EventAfterParticipantAdded;
Participants()variable EventBeforeParticipantRemoved
This event is raised before a participant is removed from theBeforeParticipantRemoved EventBeforeParticipantRemoved;
Participants()variable EventAfterParticipantUpdated
This event is raised after a participant property changes.AfterParticipantUpdated EventAfterParticipantUpdated;
variable EventTextMessageReceived
An event that indicates another player has sent the channel a text message.TextMessageReceived EventTextMessageReceived;
variable EventTranscribedMessageReceived
An event that indicates incoming transcribed text from a participant in a channel session.TranscribedMessageReceived EventTranscribedMessageReceived;