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
  • Inherit from EasyManager.cs
  • Inject EasyTextToSpeech
  • Choosing Voice Gender
  • Local Text-to-Speech (TTS)
  • Local
  • Local Queued
  • Local Screen Reader
  • Remote Text-to-Speech (TTS)
  • Remote
  • Remote Queued
  • Remote and Local Text-to-Speech (TTS)
  • Remote and Local
  • Remote and Local Queued

Was this helpful?

  1. Easy Code For Vivox
  2. How do I do this in EasyCode?

Text To Speech ( TTS )

Inherit from EasyManager.cs

using EasyCodeForVivox;

public class VivoxManager : EasyManager
{

}

Inject EasyTextToSpeech

using EasyCodeForVivox;
using UnityEngine;
using Zenject;

public class VivoxTextToSpeech : MonoBehaviour
{
    EasyTextToSpeech _textToSpeech;

    [Inject]
    private void Initialize(EasyTextToSpeech textToSpeech)
    {
        _textToSpeech = textToSpeech;
    }
}

Choosing Voice Gender

This method allows you to choose male or female voice. Vivox only supports English Voices

If you're 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

EasyManager

public void ChooseVivoxVoice()
{
    ChooseVoiceGender(VoiceGender.female, "userName");
}

EasyTextToSpeech

public void ChooseVivoxVoice()
{
    _textToSpeech.ChooseVoiceGender(VoiceGender.female, "userName");
}

Local Text-to-Speech (TTS)

Local

Speak TTS Messages Locally. Messages will play over each other

Parameters Include:

  • string message = Message to Speak

  • string userName = Username of player

EasyManager

public void TTSMsgLocalPlayOverCurrent()
{
    PlayTTSMessage("my message to play", "userName", TTSDestination.LocalPlayback);
}

EasyTextToSpeech

public void TTSMsgLocalPlayOverCurrent()
{
    _textToSpeech.PlayTTSMessage("my message to play", TTSDestination.LocalPlayback, EasySession.LoginSessions["userName"]);
}

Local Queued

Speak TTS Messages Locally. Messages will be added to a queue and played in order recieved

Parameters Include:

  • string message = Message to Speak

  • string userName = Username of player

EasyManager

public void TTSMsgQueueLocal()
{
    _textToSpeech.PlayTTSMessage("my message to play", TTSDestination.QueuedLocalPlayback, EasySession.LoginSessions["userName"]);
}

EasyTextToSpeech

public void TTSMsgQueueRemoteLocal()
{
    PlayTTSMessage("my message to play",  "userName", TTSDestination.QueuedRemoteTransmissionWithLocalPlayback);
}

Local Screen Reader

Speak TTS Messages Locally. Messages will replace each other

Parameters Include:

  • string message = Message to Speak

  • string userName = Username of player

EasyManager

public void TTSMsgLocalReplaceCurrentMessagePlaying()
{
    PlayTTSMessage("my message to play",  "userName", TTSDestination.ScreenReader);
}

EasyTextToSpeech

public void TTSMsgLocalReplaceCurrentMessagePlaying()
{
    _textToSpeech.PlayTTSMessage("my message to play", TTSDestination.ScreenReader, EasySession.LoginSessions["userName"]);
}

Remote Text-to-Speech (TTS)

Remote

Speak TTS Messages Remotely. Messages will play over each other

Parameters Include:

  • string message = Message to Speak

  • string userName = Username of player

EasyManager

public void TTSMsgRemotePlayOverCurrent()
{
    PlayTTSMessage("my message to play",  "userName", TTSDestination.RemoteTransmission);
}

EasyTextToSpeech

public void TTSMsgRemotePlayOverCurrent()
{
    _textToSpeech.PlayTTSMessage("my message to play", TTSDestination.RemoteTransmission, EasySession.LoginSessions["userName"]);
}

Remote Queued

Speak TTS Messages Remotely. Messages will be added to a queue and played in order received

Parameters Include:

  • string message = Message to Speak

  • string userName = Username of player

EasyManager

public void TTSMsgQueueRemote()
{
    PlayTTSMessage("my message to play",  "userName", TTSDestination.QueuedRemoteTransmission);
}

EasyTextToSpeech

public void TTSMsgQueueRemote()
{
    _textToSpeech.PlayTTSMessage("my message to play", TTSDestination.QueuedRemoteTransmission, EasySession.LoginSessions["userName"]);
}

Remote and Local Text-to-Speech (TTS)

Remote and Local

Speak TTS Messages Remotely and Locally. Messages will play over each other

Parameters Include:

  • string message = Message to Speak

  • string userName = Username of player

EasyManager

public void TTSMsgLocalRemotePlayOverCurrent()
{
    PlayTTSMessage("my message to play",  "userName", TTSDestination.RemoteTransmissionWithLocalPlayback);
}

EasyTextToSpeech

public void TTSMsgLocalRemotePlayOverCurrent()
{
    _textToSpeech.PlayTTSMessage("my message to play", TTSDestination.RemoteTransmissionWithLocalPlayback, EasySession.LoginSessions["userName"]);
}

Remote and Local Queued

Speak TTS Messages Remotely and Locally. Messages will be added to a queue and played in order received

Parameters Include:

  • string message = Message to Speak

  • string userName = Username of player

EasyManager

public void TTSMsgQueueRemoteLocal()
{
    PlayTTSMessage("my message to play",  "userName", TTSDestination.QueuedRemoteTransmissionWithLocalPlayback);
}

EasyTextToSpeech

public void TTSMsgQueueRemoteLocal()
{
    _textToSpeech.PlayTTSMessage("my message to play", TTSDestination.QueuedRemoteTransmissionWithLocalPlayback, EasySession.LoginSessions["userName"]);
}
PreviousAudio Device EventsNextTTS Events

Last updated 2 years ago

Was this helpful?

For more information on the available Text-To-Speech options check out the

TTSDestination = Refer to

TTSDestination = Refer to

TTSDestination = Refer to

TTSDestination = Refer to

TTSDestination = Refer to

TTSDestination = Refer to

TTSDestination = Refer to

Vivox Documentation
Vivox Documentation
Vivox Documentation
Vivox Documentation
Vivox Documentation
Vivox Documentation
Vivox Documentation
Vivox Documentation