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
#regionMain 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.
Updates the current logged in user's frequency for state changes when user is using Audio/Voice channels. If user isn't logged in then set the VivoxParticipantPropertyUpdateFrequency in EasySettings
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
Join a 3D Positional Channel. This channel is created with the recommended default 3D audio settings. Based on the settings you will only hear voice chat or receive text messages in the channel based on how close you are to other players in the same channel as you. If 2 players are close you can hear each other clearly but the farther you get away from each other the audio will fade out based on the chosen settings. More in Vivox Documentation. Development Code
Join a 3D Positional Channel. This channel is created with 3D audio settings based on the parameter inputs you choose. Based on the settings you will only hear voice chat or receive text messages in the channel based on how close you are to other players in the same channel as you. If 2 players are close you can hear each other clearly but the farther you get away from each other the audio will fade out based on the chosen settings. More in Vivox Documentation. 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. Production Code
Join a 3D Positional Channel. This channel is created with 3D audio settings. Based on the settings you will only hear voice chat or receive text messages in the channel based on how close you are to other players in the same channel as you. If 2 players are close you can hear each other clearly but the farther you get away from each other the audio will fade out based on the chosen settings. More in Vivox Documentation. Production Code
Join a 3D Positional Channel. This channel is created with 3D audio settings. Based on the settings you will only hear voice chat or receive text messages in the channel based on how close you are to other players in the same channel as you. If 2 players are close you can hear each other clearly but the farther you get away from each other the audio will fade out based on the chosen settings.
This Method is designed for MMO games where you will have different players in different regions. To have all the players in a region on the same server/shard the region parameter will add the region name to the player SIP address. Recommended to hash the channel name for all players in the channel.
You must use the private bool FilterChannelAndUserName(string nameToFilter) to filter the channel name before hashing. This method doesn't do it for you in the event your channel name is hashed
You can also add a squad name to better keep track of all the channels in the Vivox server/shard. Can be null
Region and squad name are appeneded to the channel name in this format $"{region}.{channelNameOrHash}.{squadName}";
or
$"region.channelName.squad1";
If region or squad name is null then use this format
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
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
Send direct messages to a logged in user. Both players must be connected to Vivox servers or the message will fail. Provide user name of player to send message to 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
Toggle any remote players audio on or off. This will block any audio that the muted player is speaking in the channel in which they were blocked. Only mutes them for the local user, not everyone in the channel.
Speak any text locally, remotely, or both with options to Queue messages or override old messages when a new message is played. TTSDestination will give you the options to play TTS accordingly
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)