Table of Contents

Class CustomBackend

Namespace
Refractor
Assembly
Refractor.dll

A backend written in .NET, registered with AddBackend(string, int, BackendFeatures, Func<CustomBackend?>). Override exactly the operations named in the features passed there; prism never calls the rest. Calls for one instance never overlap, but can arrive on any thread. Throw PrismException to report a specific error; any other exception becomes Internal and is written to prism's log. If the backend is IDisposable, it is disposed when prism destroys the instance.

public abstract class CustomBackend
Inheritance
CustomBackend
Inherited Members

Methods

Braille(string)

Shows text on a braille display. Braille.

public virtual void Braille(string text)

Parameters

text string

CountVoices()

How many voices there are. CountVoices.

public virtual int CountVoices()

Returns

int

GetBitDepth()

The engine's native bit depth. GetBitDepth.

public virtual int GetBitDepth()

Returns

int

GetChannels()

How many channels SpeakToMemory(string, AudioSink) produces. GetChannels.

public virtual int GetChannels()

Returns

int

GetPitch()

The pitch, from 0 to 1. GetPitch.

public virtual float GetPitch()

Returns

float

GetRate()

The rate, from 0 to 1, where 0.5 is the engine's default. GetRate.

public virtual float GetRate()

Returns

float

GetSampleRate()

The sample rate SpeakToMemory(string, AudioSink) produces, in hertz. GetSampleRate.

public virtual int GetSampleRate()

Returns

int

GetVoice()

The index of the current voice. GetVoice.

public virtual int GetVoice()

Returns

int

GetVoiceLanguage(int)

The voice's language, such as "en-US". GetVoiceLanguage.

public virtual string GetVoiceLanguage(int index)

Parameters

index int

Returns

string

GetVoiceName(int)

The voice's name. An index out of range should throw ArgumentOutOfRangeException. GetVoiceName.

public virtual string GetVoiceName(int index)

Parameters

index int

Returns

string

GetVolume()

The volume, from 0 to 1. GetVolume.

public virtual float GetVolume()

Returns

float

Initialize()

Starts the engine. Runs once, before any other operation but IsSupported().

public virtual void Initialize()

IsSpeaking()

Whether speech is in progress. IsSpeaking.

public virtual bool IsSpeaking()

Returns

bool

IsSupported()

Whether the engine can be used right now. Can run before Initialize(), on the poll thread.

public virtual bool IsSupported()

Returns

bool

Output(string, bool)

Speaks and brailles text. Output.

public virtual void Output(string text, bool interrupt)

Parameters

text string
interrupt bool

Pause()

Pauses speech where it is. Pause.

public virtual void Pause()

RefreshVoices()

Picks up voices installed since the last refresh. RefreshVoices.

public virtual void RefreshVoices()

Resume()

Carries on from Pause(). Resume.

public virtual void Resume()

SetPitch(float)

Already checked by prism to be finite and within [0, 1].

public virtual void SetPitch(float pitch)

Parameters

pitch float

SetRate(float)

Already checked by prism to be finite and within [0, 1].

public virtual void SetRate(float rate)

Parameters

rate float

SetVoice(int)

Switches to the voice at index. SetVoice.

public virtual void SetVoice(int index)

Parameters

index int

SetVolume(float)

Already checked by prism to be finite and within [0, 1].

public virtual void SetVolume(float volume)

Parameters

volume float

Speak(string, bool)

Speaks text, after stopping current speech when interrupt is true and otherwise after it. Speak.

public virtual void Speak(string text, bool interrupt)

Parameters

text string
interrupt bool

SpeakToMemory(string, AudioSink)

Synthesizes text and delivers every sample through sink before returning. SpeakToMemory.

public virtual void SpeakToMemory(string text, AudioSink sink)

Parameters

text string
sink AudioSink

Stop()

Stops speech and drops anything queued. Stop.

public virtual void Stop()