API ReferenceSandbox.Speech

Synthesizerclass

A speech synthesis stream. Lets you write text into speech and output it to a `Sandbox.SoundHandle`.

objectSynthesizer
Namespace
Sandbox.Speech
Assembly
Sandbox.Engine
Declaration
public sealed class Sandbox.Speech.Synthesizer

Constructors1

Showing 1 constructors

Methods8

Showing 8 methods

public virtual sealed void Dispose()PUBLICVIRTUAL

Returns:void

public Sandbox.Speech.Synthesizer OnVisemeReached(System.Action`2<int,System.TimeSpan> action)PUBLIC

ParameterTypeDescription
actionAction<int,TimeSpan>
Returns:Synthesizer

public Sandbox.SoundHandle Play()PUBLIC

Takes info from `Sandbox.Speech.Synthesizer.Builder` and creates a `System.Speech.Synthesis.SpeechSynthesizer`, outputting to a stream object. Using `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.

Returns:SoundHandle

public Sandbox.Speech.Synthesizer WithRate(int rate)PUBLIC

Sets the playback rate of the synthesizer.

ParameterTypeDescription
rateint
Returns:Synthesizer

public Sandbox.Speech.Synthesizer WithText(string input)PUBLIC

Adds some text to the speech.

ParameterTypeDescription
inputstring
Returns:Synthesizer

Properties2

Showing 2 properties

public string Sandbox.Speech.Synthesizer.CurrentVoice { get; set; }PUBLICGETSET

Gets the current voice being used by `Sandbox.Speech.Synthesizer.SpeechSynthesizer`.

Returns:string

public System.Collections.ObjectModel.ReadOnlyCollection`1<Sandbox.Speech.Synthesizer.InstalledVoice> Sandbox.Speech.Synthesizer.InstalledVoices { get; set; }PUBLICGETSET

Gets a list of currently installed voices on the user's system.

Returns:ReadOnlyCollection<InstalledVoice>

On this page