# Sandbox.Speech.Synthesizer

A speech synthesis stream. Lets you write text into speech and output it to a [Sandbox.SoundHandle](/api/Sandbox.SoundHandle).

- Kind: class
- Namespace: `Sandbox.Speech`
- Assembly: `Sandbox.Engine`
- Modifiers: sealed

## Constructors

- [`Synthesizer`](/api/Sandbox.Speech.Synthesizer/.ctor)

## Properties

- [`CurrentVoice`](/api/Sandbox.Speech.Synthesizer/CurrentVoice): Gets the current voice being used by `F:Sandbox.Speech.Synthesizer.SpeechSynthesizer`.
- [`InstalledVoices`](/api/Sandbox.Speech.Synthesizer/InstalledVoices): Gets a list of currently installed voices on the user's system.

## Methods

- [`Dispose`](/api/Sandbox.Speech.Synthesizer/Dispose)
- [`OnVisemeReached`](/api/Sandbox.Speech.Synthesizer/OnVisemeReached)
- [`Play`](/api/Sandbox.Speech.Synthesizer/Play): Takes info from `F:Sandbox.Speech.Synthesizer.Builder` and creates a `T:System.Speech.Synthesis.SpeechSynthesizer`, outputting to a stream object. Using `T:Sandbox.Speech.Synthesizer.AudioStreamHelpers` we then read all the PCM samples, and write it to a SoundStream. This means it'll work like any other sound.
- [`TrySetVoice`](/api/Sandbox.Speech.Synthesizer/TrySetVoice): Tries to set the voice to a matching voice name installed on the user's system.
- [`WithBreak`](/api/Sandbox.Speech.Synthesizer/WithBreak): Adds a break to the speech.
- [`WithRate`](/api/Sandbox.Speech.Synthesizer/WithRate): Sets the playback rate of the synthesizer.
- [`WithText`](/api/Sandbox.Speech.Synthesizer/WithText): Adds some text to the speech.
