Easy Code For Vivox
  • Introduction
    • Official Links
    • Getting Started
      • Wheres The Code
      • Setup EasyCode in My Project
    • Setup Demo Scenes
      • Vivox Developer Portal
      • Unity Gaming Services (UGS) Dashboard
    • Things To Consider
    • FAQ
  • Development Info
    • Design Decisions
    • Release Notes
      • v2.0
      • v1.3
      • v1.2
      • v1.1
      • Template
    • Not Supported
  • Easy Code For Vivox
    • How do I setup EasyCode?
      • Setup Your Credentials
    • How do I do this in EasyCode?
      • Login / Logout
        • Login Properties
        • SetTransmissionMode
        • Login Events
      • Join / Leave Channel
        • Audio Channel
          • Audio Channel Events
        • Text Channel
          • Text Channel Events
        • Channel Events
      • Send Messages
        • Message Events
      • Mute / Unmute
        • Mute / Unmute Events
      • Subscribe to User Events
      • Volume / Audio Settings
        • Audio Device Events
      • Text To Speech ( TTS )
        • TTS Events
    • Vivox Access Tokens
      • Unity Cloud Code
    • Supported Vivox Events
      • Callback Methods
    • Folder Structure / Info
      • / Demo Scenes /
      • / Documentation /
      • / Examples /
      • / Plugins /
      • / Resources /
      • / Scripts /
      • / Settings /
    • Common Errors
  • API Info
    • EasySession.cs
    • EasyManager.cs
      • Main Methods
      • Vivox Event Callbacks
    • Easy3DPositional.cs
    • EasyVivoxUtilities.cs
    • EasySettings.cs
    • Extension Methods
      • EasySIPExtensions.cs
      • GameObjectExtensions.cs
      • TTSMessageExtensions.cs
      • UIExtensions.cs
      • VivoxExtensions.cs
      • EasyDebug.cs
    • EasyEvents.cs
  • Dependency Injection
    • Zenject vs Extenject
    • Install Dependencies
    • Inject Classes
  • Dynamic Events
    • Dynamic Events
    • Tests
    • Gotchas
    • Dynamic Async Events
      • Dont Do
    • Event Examples
  • Related Info
    • How do I do this in Vivox?
      • Conference Chat
    • Pre-Processor Directives
    • How to set iOS Info.plist for Unity?
    • Unity Gaming Services
  • The Future
    • Roadmap
    • Todo / Notes / Changelog
Powered by GitBook
On this page

Was this helpful?

  1. API Info
  2. EasyManager.cs

Vivox Event Callbacks

Login Setup

Callback that requests Android/iOS mic Permission and chooses the Text-To-Speech Voice for the current login session

    private void OnLoggedInSetup(ILoginSession loginSession)
    {
        EasyVivoxUtilities.RequestAndroidMicPermission();
        EasyVivoxUtilities.RequestIOSMicrophoneAccess();
        ChooseVoiceGender(_settings.VoiceGender, loginSession);
    }

The rest are pretty self-explanatory so making nicer docs for this is not a priority at the moment

    #region Login / Logout Callbacks


    protected virtual void OnLoggingIn(ILoginSession loginSession)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"Logging In : {loginSession.LoginSessionId.DisplayName}");
    }

    protected virtual void OnLoggedIn(ILoginSession loginSession)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"Logged in : {loginSession.LoginSessionId.DisplayName}  : Presence = {loginSession.Presence.Status}");
    }

    protected virtual void OnLoggingOut(ILoginSession loginSession)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"Logging out : {loginSession.LoginSessionId.DisplayName}  : Presence = {loginSession.Presence.Status}");
    }

    protected virtual void OnLoggedOut(ILoginSession loginSession)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"Logged out : {loginSession.LoginSessionId.DisplayName}  : Presence = {loginSession.Presence.Status}");
    }



    private void OnLoggedInSetup(ILoginSession loginSession)
    {
        EasyVivoxUtilities.RequestAndroidMicPermission();
        EasyVivoxUtilities.RequestIOSMicrophoneAccess();
        ChooseVoiceGender(_settings.VoiceGender, loginSession);
    }


    // todo add Extra/Multiple Login callbacks to EasyLogin

    protected virtual void OnLoginAdded(AccountId accountId)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"LoginSession Added : For user {accountId.Name}");
    }

    protected virtual void OnLoginRemoved(AccountId accountId)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"Login Removed : For user {accountId}");
    }

    protected virtual void OnLoginUpdated(ILoginSession loginSession)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"LoginSession has been Updated : {loginSession.LoginSessionId.DisplayName} : Presence = {loginSession.Presence.Status}");
    }


    #endregion


    #region Audio / Text / Channel Callbacks


    protected virtual void OnChannelConnecting(IChannelSession channelSession)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"{channelSession.Channel.Name} Is Connecting");
    }

    protected virtual void OnChannelConnected(IChannelSession channelSession)
    {
        if (_settings.LogEasyManagerEventCallbacks)
        {
            Debug.Log($"{channelSession.Channel.Name} Has Connected");
            Debug.Log($"Channel Type == {channelSession.Channel.Type}");
        }
    }

    protected virtual void OnChannelDisconnecting(IChannelSession channelSession)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"{channelSession.Channel.Name} Is Disconnecting");
    }

    protected virtual void OnChannelDisconnected(IChannelSession channelSession)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"{channelSession.Channel.Name} Has Disconnected");
        _channel.RemoveChannelSession(channelSession.Channel.Name);
    }



protected virtual void OnAudioChannelConnecting(IChannelSession channelSession)
{
    if (_settings.LogEasyManagerEventCallbacks)
        Debug.Log($"{channelSession.Channel.Name} Audio Is Connecting In Channel");
}

protected virtual void OnAudioChannelConnected(IChannelSession channelSession)
{
    if (_settings.LogEasyManagerEventCallbacks)
        Debug.Log($"{channelSession.Channel.Name} Audio Has Connected In Channel");
}

protected virtual void OnAudioChannelDisconnecting(IChannelSession channelSession)
{
    if (_settings.LogEasyManagerEventCallbacks)
        Debug.Log($"{channelSession.Channel.Name} Audio Is Disconnecting In Channel");
}

protected virtual void OnAudioChannelDisconnected(IChannelSession channelSession)
{
    if (_settings.LogEasyManagerEventCallbacks)
        Debug.Log($"{channelSession.Channel.Name} Audio Has Disconnected In Channel");
}




    protected virtual void OnTextChannelConnecting(IChannelSession channelSession)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"{channelSession.Channel.Name} Text Is Connecting In Channel");
    }

    protected virtual void OnTextChannelConnected(IChannelSession channelSession)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"{channelSession.Channel.Name} Text Has Connected In Channel");
    }

    protected virtual void OnTextChannelDisconnecting(IChannelSession channelSession)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"{channelSession.Channel.Name} Text Is Disconnecting In Channel");
    }

    protected virtual void OnTextChannelDisconnected(IChannelSession channelSession)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"{channelSession.Channel.Name} Text Has Disconnected In Channel");
    }



    #endregion


    #region Local User Mute Callbacks

    protected virtual void OnLocalUserMuted()
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log("Local User is Muted");
    }

    protected virtual void OnLocalUserUnmuted()
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log("Local User is Unmuted");
    }

    #endregion

    #region User Callbacks


    protected virtual void OnUserJoinedChannel(IParticipant participant)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"{participant.Account.DisplayName} Has Joined The Channel");
    }

    protected virtual void OnUserLeftChannel(IParticipant participant)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"{participant.Account.DisplayName} Has Left The Channel");

    }

    protected virtual void OnUserValuesUpdated(IParticipant participant)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"{participant.Account.DisplayName} Has updated itself in the channel");

    }

    protected virtual void OnUserMuted(IParticipant participant)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"{participant.Account.DisplayName} Is Muted : (Muted For All : {participant.IsMutedForAll})");

    }

    protected virtual void OnUserUnmuted(IParticipant participant)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"{participant.Account.DisplayName} Is Unmuted : (Muted For All : {participant.IsMutedForAll})");

    }

    protected virtual void OnUserSpeaking(IParticipant participant)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"{participant.Account.DisplayName} Is Speaking : Audio Energy {participant.AudioEnergy}");

    }

    protected virtual void OnUserNotSpeaking(IParticipant participant)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"{participant.Account.DisplayName} Is Not Speaking");
    }


    #endregion


    #region Message Callbacks


    protected virtual void OnChannelMessageRecieved(IChannelTextMessage textMessage)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"From {textMessage.Sender.DisplayName} : {textMessage.ReceivedTime} : {textMessage.Message}");
    }

    protected virtual void OnEventMessageRecieved(IChannelTextMessage textMessage)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"Event Message From {textMessage.Sender.DisplayName} : {textMessage.ReceivedTime} : {textMessage.ApplicationStanzaNamespace} : {textMessage.ApplicationStanzaBody} : {textMessage.Message}");
    }

    protected virtual void OnDirectMessageRecieved(IDirectedTextMessage directedTextMessage)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"Recived Message From : {directedTextMessage.Sender.DisplayName} : {directedTextMessage.ReceivedTime} : {directedTextMessage.Message}");
    }

    protected virtual void OnDirectMessageFailed(IFailedDirectedTextMessage failedMessage)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"Failed To Send Message From : {failedMessage.Sender}");
    }




    #endregion


    #region Text-to-Speech Callbacks

    protected virtual void OnTTSMessageAdded(ITTSMessageQueueEventArgs ttsArgs)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"TTS Message Has Been Added : {ttsArgs.Message.Text}");
    }

    protected virtual void OnTTSMessageRemoved(ITTSMessageQueueEventArgs ttsArgs)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"TTS Message Has Been Removed : {ttsArgs.Message.Text}");
    }

    protected virtual void OnTTSMessageUpdated(ITTSMessageQueueEventArgs ttsArgs)
    {
        if (_settings.LogEasyManagerEventCallbacks)
            Debug.Log($"TTS Message Has Been Updated : {ttsArgs.Message.Text}");
    }


    #endregion
PreviousMain MethodsNextEasy3DPositional.cs

Last updated 2 years ago

Was this helpful?