Important: This is documentation for the legacy version of the Vivox Unity SDK. This documentation will be removed after July 2025. Refer to the v16 documentation for the new version of the SDK.
Text-to-speech voice options
Before you inject a text-to-speech (TTS) message or read text locally, you can choose the voice to use for synthesizing speech. You can set this option per user at any time.
Two voices are available: male and female. You can list all available voices by using the following script:
foreach (ITTSVoice voice in myLoginSession.TTS.AvailableVoices)
{ Console.WriteLine($"Available Voice: Name=[{voice.Name}]"); }
// Available Voice: Name=[en_US male]
// Available Voice: Name=[en_US female]
ITTSVoice newVoice = myLoginSession.TTS.AvailableVoices.FirstOrDefault(v => v.Name == "en_US female");
if (newVoice != null)
{ myLoginSession.TTS.CurrentVoice = newVoice; }
Console.WriteLine($"Current Voice: {myLoginSession.TTS.CurrentVoice.Name}");
// Current Voice: en_US female
When you call a TTS method that calls for speech to be synthesized, the system uses the ITTSVoice
that is set as the current voice for that user. If no voice is selected, the system uses the Vivox SDK default.