CasCap.Api.Voice.Testing 0.1.2

Prefix Reserved
dotnet add package CasCap.Api.Voice.Testing --version 0.1.2
                    
NuGet\Install-Package CasCap.Api.Voice.Testing -Version 0.1.2
                    
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="CasCap.Api.Voice.Testing" Version="0.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CasCap.Api.Voice.Testing" Version="0.1.2" />
                    
Directory.Packages.props
<PackageReference Include="CasCap.Api.Voice.Testing" />
                    
Project file
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 CasCap.Api.Voice.Testing --version 0.1.2
                    
#r "nuget: CasCap.Api.Voice.Testing, 0.1.2"
                    
#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 CasCap.Api.Voice.Testing@0.1.2
                    
#: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=CasCap.Api.Voice.Testing&version=0.1.2
                    
Install as a Cake Addin
#tool nuget:?package=CasCap.Api.Voice.Testing&version=0.1.2
                    
Install as a Cake Tool

CasCap.Api.Voice.Testing

Canned speech-to-text and text-to-speech clients for testing code built on CasCap.Api.Voice without a speech backend.

Installation

dotnet package add CasCap.Api.Voice.Testing

Reference it from test projects only.

Purpose

The Voice pipelines depend on the Microsoft.Extensions.AI ISpeechToTextClient and ITextToSpeechClient contracts. These fakes stand in for a real provider, so a consumer can exercise transcription, synthesis and its own orchestration deterministically. There is no network, audio tooling or credential involved.

Target framework: net10.0

Public Surface

All types live in the CasCap.Fakes namespace.

Type Behaviour
FakeSpeechToTextClient Returns Transcript. It counts Requests, fails with Failure when set, and waits on Gate when set, so a test can observe work that is still in flight.
FakeTextToSpeechClient Returns Audio with MediaType (Ogg Opus by default). It counts Requests, records LastText, and fails with Failure when set.

Both contracts are published as experimental (MEAI001). Consumers that reference the fakes by their interface type need the same suppression that production code uses.

Usage

Replace the provider client before the Voice pipeline is resolved:

var stt = new FakeSpeechToTextClient { Transcript = "what trades are open" };
var tts = new FakeTextToSpeechClient();

services.AddSpeechToText();
services.AddTextToSpeech();
services.AddSingleton<ISpeechToTextClient>(stt);
services.AddSingleton<ITextToSpeechClient>(tts);

AddSpeechToText and AddTextToSpeech register their provider clients with TryAdd. A fake registered before them therefore takes precedence, and so does a later plain AddSingleton.

Product 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.2 58 9/29/2026