Table of Contents

Namespace Refractor

Classes

AudioSink

Where SpeakToMemory(string, AudioSink) sends audio. It only works during that call: prism's receiver is gone once it returns, so a later Write(ReadOnlySpan<float>, int, int) throws ObjectDisposedException.

Backend

A speech, braille or screen reader output. Not thread safe: use one instance from one thread at a time. Check GetFeatures() before relying on an operation, since an unsupported one throws PrismException with NotImplemented.

CustomBackend

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.

LogMessageEventArgs

One of prism's log messages.

Prism

A prism context: the entry point for finding and creating backends. Registry calls are thread safe. Backends it hands out stay usable after it is disposed.

PrismException

Thrown when prism reports an error. Error holds the code.

PrismLog

prism's process wide logger. Usable before any Prism exists. Setting the PRISM_LOG environment variable to a level name makes prism log to standard error on its own, until a handler is added to MessageLogged.

PrismOptions

Settings for a new Prism context.

Registry

A fixed set of backends from Freeze(), bound to a context through Registry. Contexts keep their own reference, so this one can be disposed as soon as they are created.

RegistryBuilder

Collects custom and plugin backends into a Registry. It starts with every built-in backend.

Voice

A voice a backend offers. Index can change after RefreshVoices().

Structs

BackendId

A backend's stable identifier, hashed by prism from its name. An id here only says a backend exists somewhere; HasBackend(BackendId) says whether this platform's prism has it.

Enums

BackendFeatures

What a backend implements, plus whether its engine is running right now. Each operation flag names the Backend member it allows; a member whose flag is missing throws PrismException with NotImplemented.

LogLevel

How severe a log message is, ordered from least to most severe.

PrismError

A prism error code, carried by Error. The numbers are part of prism's ABI and never change.

Delegates

AudioCallback

Receives synthesized audio: interleaved samples in [-1, 1], valid only during the call.

AvailabilityChangedHandler

Reports that a backend became available (true) or unavailable (false).