Posts

Showing posts with the label Unity3D

SAPI Interface and Unity3d

Enumerating and Changing voices in Unity3d Text To Speech So, you incorporated the text to speech in to Unity and want to change the voice, every time you add a new voice, the index changes?  Same here. I looked around for solutions on the web, but found out that it was a bit tricky.  Well, frustrated with it I wrote the following code will enumerate installed voices on the current system, and allow a text search against the voices.  It runs at start, and is best used attached to a new project, on an object. Comment if you have any questions or ideas on how to make it better.  Enjoy! using UnityEngine; using System.Collections; using SpeechLib; using System.Xml; using System.IO; public class VoiceTrigger : MonoBehaviour { private SpVoice voice ; private bool seenMe = false ; // "CereVoice Katherine - English (East Coast America)" -- example of name in system panel, and used in normal SAPI C# to call it a...