Verbara.Sdk.VoiceAi.Tts 2.2.1

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

Verbara.Sdk.VoiceAi.Tts

Text-to-speech providers for Verbara.Sdk.VoiceAi turn-based pipelines. 6 providers, each implementing ISpeechSynthesizer from Verbara.Sdk.VoiceAi. Native AOT, zero reflection, hand-rolled HTTP/WebSocket clients (no vendor SDK dependencies). MIT licensed.

Providers

Provider Mode TTFA target Notes
ElevenLabs Streaming WebSocket ~150 ms (Flash 2.5) Production default. Premium quality. Multi-language. Flash 2.5 default since v1.15.3.
Cartesia (Sonic-3) Streaming WebSocket 40-90 ms Lowest TTFA in the catalog. Production-grade quality.
Speechmatics Streaming WebSocket ~200 ms Enterprise-grade with multi-locale.
Azure REST batch ~500 ms Microsoft Cognitive Services TTS. Mature, broad locale support. Batch mode (no streaming).
Deepgram Aura 2 Streaming WebSocket ~150-200 ms New in v1.15.3. Aura 2 voices via wss://api.deepgram.com/v1/speak. Token-by-token input streaming.
LMNT Streaming WebSocket (HTTP fallback) sub-200 ms New in v1.15.3. Sub-200 ms TTFA target for conversational AI agents.

TTFA = Time-To-First-Audio. Streaming providers begin returning PCM bytes mid-synthesis; batch providers return the full clip in one response. All providers report metrics via the Verbara.Sdk.VoiceAi.Tts Meter (latency histogram, TTFA histogram, request counters, byte throughput tagged by provider name). Health checks (TtsHealthCheck) auto-registered when the synthesizer is added through DI.

Observability — metric catalog

All metrics are emitted on Meter name Verbara.Sdk.VoiceAi.Tts.

Metric Type Unit Description
tts.syntheses.started Counter syntheses Synthesis attempts started
tts.syntheses.completed Counter syntheses Syntheses completed successfully
tts.syntheses.failed Counter syntheses Syntheses failed with error
tts.synthesis.characters Counter {characters} Total characters synthesized
tts.synthesis.latency_ms Histogram ms Total synthesis latency (start → last frame). Buckets: 5/10/25/50/100/250/500/1000/2500/5000 ms
tts.synthesis.ttfa_ms Histogram ms Time-to-first-audio: elapsed from synthesis start until first audio frame yielded to caller. Tags: voiceai.provider. Buckets: 5/10/25/50/100/250/500/1000/2500/5000 ms

The tts.synthesis.ttfa_ms histogram is the key metric for evaluating provider responsiveness in interactive voice agents. Compare across providers using the voiceai.provider tag.

Install

dotnet add package Verbara.Sdk.VoiceAi.Tts

You almost always want Verbara.Sdk.VoiceAi (the orchestration package) too:

dotnet add package Verbara.Sdk.VoiceAi

Quick start (ElevenLabs)

using Verbara.Sdk.VoiceAi.Tts.DependencyInjection;

services.AddElevenLabsSpeechSynthesizer(o =>
{
    o.ApiKey = configuration["ElevenLabs:ApiKey"]!;
    o.VoiceId = "EXAVITQu4vr4xnSDxMaL";   // "Bella" — pick any from your ElevenLabs library
    o.Model = "eleven_flash_v2_5";        // Flash 2.5 for lowest TTFA
});

The synthesizer is now resolvable as ISpeechSynthesizer and registered with the VoiceAi pipeline.

Per-provider DI extensions

Each provider has its own Add*SpeechSynthesizer extension (in Verbara.Sdk.VoiceAi.Tts.DependencyInjection):

services.AddElevenLabsSpeechSynthesizer(o => { ... });
services.AddCartesiaSpeechSynthesizer(o => { ... });
services.AddSpeechmaticsSpeechSynthesizer(o => { ... });
services.AddAzureTtsSpeechSynthesizer(o => { ... });

Choosing a provider

  • Best TTFA → Cartesia Sonic-3 (40-90 ms). Lowest perceived latency for interactive AI agents.
  • Best quality / familiarity → ElevenLabs (Flash 2.5 is fast; Multilingual v2 is premium).
  • Best language coverage → Azure TTS (broad locale support; batch-only).
  • Mid-market enterprise → Speechmatics (good balance).

Examples

  • Examples/VoiceAiExample/ — ElevenLabs + Deepgram + echo handler (default demo).
  • Examples/VoiceAiCartesiaExample/ — Cartesia Sonic-3 with sub-100 ms TTFA.
  • Examples/VoiceAiSpeechmaticsExample/ — Speechmatics TTS.

Native AOT

All HTTP/WebSocket clients hand-rolled with HttpClient / ClientWebSocket. JSON serialization via source-generated JsonSerializerContext (VoiceAiTtsJsonContext). 0 trim warnings. See ADR-0014 for the no-vendor-SDK rationale.

License

MIT. Part of the Verbara.Sdk project.

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
2.2.1 162 5/23/2026
2.2.0 113 5/20/2026
2.1.2 109 5/8/2026
2.1.1 97 5/7/2026
2.1.0 643 5/7/2026
2.0.0 107 5/6/2026