Skip to content
Introducing AI Conversations: Natural Language Interaction for Your Apps! Learn More

Azure AI Speech

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

Azure AI Speech provides enterprise-grade cloud speech-to-text and text-to-speech powered by Azure Cognitive Services. It replaces the platform-native ISpeechToTextService and ITextToSpeechService registrations with cloud-backed implementations while still using platform-native audio capture and playback.

Shiny.Speech.AzureNuGet package Shiny.Speech.Azure
// In MauiProgram.cs
builder.Services.AddAzureSpeech("your-subscription-key", "eastus");
// IAudioSource and IAudioPlayer are automatically registered for platform audio I/O

Or with a config object and selective services:

builder.Services.AddAzureSpeech(
new AzureSpeechConfig
{
SubscriptionKey = "your-subscription-key",
Region = "eastus"
},
speechToText: true,
textToSpeech: true
);
public record AzureSpeechConfig
{
public required string SubscriptionKey { get; init; }
public required string Region { get; init; }
}
PropertyDescription
SubscriptionKeyYour Azure Speech Services subscription key
RegionAzure region (e.g., eastus, westus2, westeurope)

Once registered, inject and use ISpeechToTextService and ITextToSpeechService exactly as you would with platform-native speech — the API is identical:

public class MyViewModel(ISpeechToTextService stt, ITextToSpeechService tts)
{
async Task ListenAndRespond(CancellationToken ct)
{
var access = await stt.RequestAccess();
if (access != AccessState.Available)
return;
var text = await stt.ListenUntilSilence(cancellationToken: ct);
if (text != null)
await tts.SpeakAsync($"You said: {text}");
}
}

You can register Azure for just one service:

// Azure STT only (use platform-native TTS)
builder.Services.AddTextToSpeech(); // Platform-native TTS
builder.Services.AddAzureSpeech("key", "region", speechToText: true, textToSpeech: false);
// Azure TTS only (use platform-native STT)
builder.Services.AddSpeechToText(); // Platform-native STT
builder.Services.AddAzureSpeech("key", "region", speechToText: false, textToSpeech: true);