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
textstring
CountVoices()
How many voices there are. CountVoices.
public virtual int CountVoices()
Returns
GetBitDepth()
The engine's native bit depth. GetBitDepth.
public virtual int GetBitDepth()
Returns
GetChannels()
How many channels SpeakToMemory(string, AudioSink) produces. GetChannels.
public virtual int GetChannels()
Returns
GetPitch()
The pitch, from 0 to 1. GetPitch.
public virtual float GetPitch()
Returns
GetRate()
The rate, from 0 to 1, where 0.5 is the engine's default. GetRate.
public virtual float GetRate()
Returns
GetSampleRate()
The sample rate SpeakToMemory(string, AudioSink) produces, in hertz. GetSampleRate.
public virtual int GetSampleRate()
Returns
GetVoice()
The index of the current voice. GetVoice.
public virtual int GetVoice()
Returns
GetVoiceLanguage(int)
The voice's language, such as "en-US". GetVoiceLanguage.
public virtual string GetVoiceLanguage(int index)
Parameters
indexint
Returns
GetVoiceName(int)
The voice's name. An index out of range should throw ArgumentOutOfRangeException. GetVoiceName.
public virtual string GetVoiceName(int index)
Parameters
indexint
Returns
GetVolume()
The volume, from 0 to 1. GetVolume.
public virtual float GetVolume()
Returns
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
IsSupported()
Whether the engine can be used right now. Can run before Initialize(), on the poll thread.
public virtual bool IsSupported()
Returns
Output(string, bool)
Speaks and brailles text. Output.
public virtual void Output(string text, bool interrupt)
Parameters
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()
public virtual void Resume()
SetPitch(float)
Already checked by prism to be finite and within [0, 1].
public virtual void SetPitch(float pitch)
Parameters
pitchfloat
SetRate(float)
Already checked by prism to be finite and within [0, 1].
public virtual void SetRate(float rate)
Parameters
ratefloat
SetVoice(int)
Switches to the voice at index. SetVoice.
public virtual void SetVoice(int index)
Parameters
indexint
SetVolume(float)
Already checked by prism to be finite and within [0, 1].
public virtual void SetVolume(float volume)
Parameters
volumefloat
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
SpeakToMemory(string, AudioSink)
Synthesizes text and delivers every sample through sink before returning. SpeakToMemory.
public virtual void SpeakToMemory(string text, AudioSink sink)
Parameters
Stop()
Stops speech and drops anything queued. Stop.
public virtual void Stop()