Prismatoid 0.3.0
dotnet add package Prismatoid --version 0.3.0
NuGet\Install-Package Prismatoid -Version 0.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Prismatoid" Version="0.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Prismatoid" Version="0.3.0" />
<PackageReference Include="Prismatoid" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Prismatoid --version 0.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Prismatoid, 0.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Prismatoid@0.3.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Prismatoid&version=0.3.0
#tool nuget:?package=Prismatoid&version=0.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Prismatoid
High-performance .NET bindings for the Prism speech library.
Usage
Initialize a PrismContext at application startup. Use the context to acquire backends, either by requesting the highest-priority one or selecting a specific driver.
using Prismatoid;
// Initialize context, keep this around and dispose it when done.
using var context = new PrismContext();
// Acquire the current best backend.
using var backend = context.AcquireBestBackend();
// Output to speech, braille, or both
backend.Speak("Speech only", interrupt: false);
backend.Braille("Braille only");
backend.Output("Both speech and braille", interrupt: true);
Advanced Voice and Backend Selection
Drivers and voices are exposed as enumerables, making them easy to query using LINQ.
// Find an English voice with specific criteria
var englishVoice = backend.Voices
.FirstOrDefault(v => v.Language.StartsWith("en") && v.Name.Contains("Hazel"));
if (englishVoice != default)
{
backend.CurrentVoice = englishVoice;
}
// Adjust speech parameters
if ((backend.Features & PrismBackendFeature.SupportsSetRate) != 0)
backend.Rate = 0.75f;
if ((backend.Features & PrismBackendFeature.SupportsSetVolume) != 0)
backend.Volume = 1.0f;
Audio Synthesis
Some backends support direct synthesis to memory.
// Synthesize text and stream 32-bit interleaved float PCM data
foreach (var chunk in backend.SpeakToMemory("Hello from the memory backend"))
{
// Process audio chunk (ReadOnlyMemory<float>)
Console.WriteLine($"Received {chunk.Length} samples");
}
Manual Backend Management
You can inspect all registered backends to verify support or manually select preferred implementations using LINQ.
// Enumerate available drivers
var drivers = context.AvailableBackends
.OrderByDescending(b => b.Priority);
foreach (var driver in drivers)
{
Console.WriteLine($"[{driver.Id:X}] {driver.Name} (Supported: {driver.IsSupported})");
}
// Select a backend using LINQ (e.g., find the SAPI driver)
var sapi = context.AvailableBackends.FirstOrDefault(b => b.Name == "SAPI");
if (sapi != default)
{
// Acquire reuses a cached native instance if one exists
using var backend = context.AcquireBackend(sapi);
}
// or create a unique instance bypassing the internal cache.
// Use this for independent state (voice, rate, pitch) from the rest of the application.
using var unique = context.CreateBestBackend();
// You can also create a specific backend manually
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.