Verbara.Sdk.VoiceAi.Testing
2.1.1
See the version list below for details.
dotnet add package Verbara.Sdk.VoiceAi.Testing --version 2.1.1
NuGet\Install-Package Verbara.Sdk.VoiceAi.Testing -Version 2.1.1
<PackageReference Include="Verbara.Sdk.VoiceAi.Testing" Version="2.1.1" />
<PackageVersion Include="Verbara.Sdk.VoiceAi.Testing" Version="2.1.1" />
<PackageReference Include="Verbara.Sdk.VoiceAi.Testing" />
paket add Verbara.Sdk.VoiceAi.Testing --version 2.1.1
#r "nuget: Verbara.Sdk.VoiceAi.Testing, 2.1.1"
#:package Verbara.Sdk.VoiceAi.Testing@2.1.1
#addin nuget:?package=Verbara.Sdk.VoiceAi.Testing&version=2.1.1
#tool nuget:?package=Verbara.Sdk.VoiceAi.Testing&version=2.1.1
Verbara.Sdk.VoiceAi.Testing
Test fakes for Verbara.Sdk.VoiceAi — exercise your turn-based pipeline, conversation handlers, and AudioSocket plumbing without touching real STT/TTS APIs (no API keys, no network, no flakiness). Native AOT, zero reflection, MIT licensed.
What it does
Three fakes, all implementing the same interfaces as the real providers:
| Fake | Replaces | Behavior |
|---|---|---|
FakeSpeechRecognizer |
ISpeechRecognizer |
Emits a configured sequence of transcripts on cue. Supports per-turn delay simulation. |
FakeSpeechSynthesizer |
ISpeechSynthesizer |
Returns canned PCM16 byte arrays. Configurable byte count + delivery cadence to simulate streaming TTFA. |
FakeConversationHandler |
IConversationHandler |
Echoes input or returns scripted responses. Useful when testing Stt + Tts wiring without business logic. |
Drop-in replacements: same DI shape, same lifecycle, same telemetry surface — your wiring code stays unchanged between unit tests and production.
Install
dotnet add package Verbara.Sdk.VoiceAi.Testing
Typically referenced from your test project only.
Quick start
using Verbara.Sdk.VoiceAi.Testing;
using Verbara.Sdk.VoiceAi.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
// Stub the recognizer with a fixed transcript sequence
var fakeStt = new FakeSpeechRecognizer();
fakeStt.QueueTranscript("hello world");
fakeStt.QueueTranscript("goodbye");
// Stub the synthesizer with a 16 kHz / 200 ms PCM clip
var fakeTts = new FakeSpeechSynthesizer { OutputSampleCount = 3200 };
var services = new ServiceCollection();
services.AddSingleton<ISpeechRecognizer>(fakeStt);
services.AddSingleton<ISpeechSynthesizer>(fakeTts);
services.AddVoiceAiPipeline<MyConversationHandler>();
var provider = services.BuildServiceProvider();
var pipeline = provider.GetRequiredService<IVoiceAiPipeline>();
await pipeline.ProcessTurnAsync(audioInput, ct);
Assert.Equal(2, fakeStt.TranscriptsConsumed);
Assert.True(fakeTts.SynthesizeInvocations >= 1);
Why use it
- No API keys in CI — your test pipeline runs offline against deterministic fakes.
- Deterministic timing — pin TTFA / latency assertions to fake delays, not provider variance.
- Failure injection — every fake exposes hooks to throw on the next call, simulate slow responses, or report partial transcripts.
- Fast — fakes return synchronously where possible; full pipeline turns finish in microseconds.
Examples
See Tests/Verbara.Sdk.VoiceAi.Tests/ and Tests/Verbara.Sdk.VoiceAi.Testing.Tests/ for end-to-end usage patterns including barge-in, turn-taking, and pipeline-level integration tests.
License
MIT. Part of the Verbara.Sdk project.
| 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. |
-
net10.0
- Verbara.Sdk.VoiceAi (>= 2.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.