Main Methods

Work In Progress

Main methods in EasyManager.cs you will be calling from derived class or referenced using GetComponent<> covered here

Another preprocessor directive but this is used by your IDE (Integrated Development Environment) [such as VS Code, VS 2022, Rider] of choice to help separate code functionality in long scripts

 #region Main Vivox Methods For Implementing In UI or call from code

Login / Logout

Logs into Vivox if the username is valid(EasyCode validates username) and no one else currently logged In has the same name, Developer is responsible for checking/implementing this. Takes string username as a parameter. Sets the transmission mode to all so any Voice or Text chat automatically switches to a new channel whenever a channel is joined or switched.

public void LoginToVivox(string userName, bool joinMuted = false)
{
    _login.LoginToVivox(userName, joinMuted);
}

Join Channel

Development Code

Join an Echo channel. Used mainly to test microphone input and speaker output. Will echo back what you speak in the mic onto your device. Development Code

 public void VivoxJoinChannelEcho(string channelName, bool includeVoice, bool includeText, bool switchToThisChannel)
 {
     if (FilterChannelAndUserName(channelName))
     {
     JoinChannelEcho(channelName, includeVoice, includeText, switchToThisChannel);
     }
 }

Production Code

Join a Non-Positional channel. Similar to talking on the phone. Production Code.

public void VivoxJoinChannelProductionNonPositional(string channelName, bool includeVoice, bool includeText, bool switchToThisChannel, bool joinMuted = false)
 {
     if (FilterChannelAndUserName(channelName))
     {
         JoinChannelProduction(channelName, includeVoice, includeText, switchToThisChannel, joinMuted);
     }
 }

Leave a channel by providing the channel name. If using the MMO method public void VivoxJoinChannelProduction3DPositionalMMO() then you should pass channel name should be in this format

 public void VivoxLeaveChannel(string channelname)
 {
     LeaveChannel(channelname);
 }

Toggle Voice / Text

Toggle Voice Chat on or off in a channel. Must be connected to a channel or you will receive an error

 public void VivoxToggleVoiceInChannel(string channelName, bool toggleOn)
 {
     SetVoiceActiveInChannel(channelName, toggleOn);
 }

Send Messages

Send messages in a Text Channel. Must be connected to an active Text channel. Provide channel name and message. You can also provide secret messages that only the developer can see unless you wish your players to see these messages. In the Vivox Documentation this is referred to as applicationStanzaNamespace and applicationStanzaBody

 public void VivoxSendChannelMessage(string channelName, string msg, string commandNameSpace = null, string commandBody = null)
 {
     SendChannelMessage(channelName, msg, commandNameSpace, commandBody);
 }

Toggle Mute

Toggle the local players audio on or off. This will stop Vivox from transmitting any audio to any channels the user is connected to.

 public void VivoxToggleMuteSelf(bool mute)
 {
     ToggleMuteSelf(mute);
 }

Volume Adjustment

Adjust the Voice volume of local player/user on the machine

 public void VivoxAdjustLocalUserVoiceVolume(int volume)
 {
     AdjustLocalUserVolume(volume);
 }

Text To Speech ( TTS )

Speak any text locally [TTS = Text-To-Speech] Will not send over the Vivox network

 public void VivoxTTSSpeakMsgLocal(string msgToSpeak)
 {
     SpeakTTS(msgToSpeak);
 }

This method allows you to choose male or female voice

(**If your a Christian the male voice doesn’t pronounce Jesus’s name correctly so I recommend using the female voice or you can provide your players with the option to choose)

 public void VivoxChooseTTSVoiceGender(VoiceGender voiceGender)
 {
     ChooseVoiceGender(voiceGender);
 }
End of the #If region explained in the beginning of this documentation
 #endregion

Last updated