Skip to content
Shiny.Maui.Shell v6 support for AI routing tools Learn More

ElevenLabs

DownloadsNuGet downloads for Shiny.Speech.ElevenLabs
Frameworks
.NET
.NET MAUI
Operating Systems
Android
iOS
Windows

ElevenLabs provides high-quality, AI-powered text-to-speech with natural-sounding voices and multilingual support. This provider replaces the platform-native ITextToSpeechService registration with ElevenLabs cloud synthesis while still using platform-native audio playback.

Shiny.Speech.ElevenLabsNuGet package Shiny.Speech.ElevenLabs
// In MauiProgram.cs
builder.Services.AddAudioPlayer(); // Platform-native audio playback (required)
builder.Services.AddElevenLabsTextToSpeech("your-api-key");

Or with a config object for additional options:

builder.Services.AddAudioPlayer();
builder.Services.AddElevenLabsTextToSpeech(new ElevenLabsConfig
{
ApiKey = "your-api-key",
DefaultVoiceId = "21m00Tcm4TlvDq8ikWAM", // Rachel (default)
ModelId = "eleven_multilingual_v2" // default
});
public record ElevenLabsConfig
{
public required string ApiKey { get; init; }
public string DefaultVoiceId { get; init; } = "21m00Tcm4TlvDq8ikWAM"; // Rachel
public string ModelId { get; init; } = "eleven_multilingual_v2";
}
PropertyDescriptionDefault
ApiKeyYour ElevenLabs API key(required)
DefaultVoiceIdVoice ID to use when none specified in TextToSpeechOptions21m00Tcm4TlvDq8ikWAM (Rachel)
ModelIdThe TTS model to useeleven_multilingual_v2

Once registered, inject and use ITextToSpeechService exactly as you would with platform-native speech:

public class MyViewModel(ITextToSpeechService tts)
{
async Task Speak()
{
// Simple speech with default voice
await tts.SpeakAsync("Hello from ElevenLabs!");
// List available ElevenLabs voices
var voices = await tts.GetVoicesAsync();
// Speak with a specific voice
var voice = voices.FirstOrDefault(v => v.Name.Contains("Adam"));
if (voice != null)
{
await tts.SpeakAsync("Hello!", new TextToSpeechOptions
{
Voice = voice,
SpeechRate = 1.0f,
Volume = 0.9f
});
}
}
}

A common pattern is to use ElevenLabs for high-quality TTS while keeping platform-native STT:

builder.Services.AddSpeechToText(); // Platform-native STT
builder.Services.AddAudioPlayer(); // Platform-native playback
builder.Services.AddElevenLabsTextToSpeech("your-api-key");