Skip to content
Shiny Controls v1.0 - The Ultra Control Suite for .NET MAUI & BlazorO...M...G!

Typecast

Downloads NuGet downloads for Shiny.Speech.Typecast
Frameworks
.NET
.NET MAUI
Operating Systems
Android
iOS
Windows

Typecast is an AI voice / text-to-speech service. This provider wraps the official typecast-csharp SDK and plugs it into Shiny.Speech as an ITextToSpeechProvider, replacing the platform-native ITextToSpeechService while still using platform-native audio playback (IAudioPlayer).

Typecast is text-to-speech only. There is no speech-to-text provider — pair it with Azure, ElevenLabs, OpenAI, or native STT if you need recognition.

// In MauiProgram.cs
builder.Services.AddTypecastSpeech("your-typecast-api-key");
// AddTypecastTextToSpeech(...) is an identical alias.
// IAudioPlayer is automatically registered for platform audio playback.

Or with a config object:

builder.Services.AddTypecastSpeech(new TypecastConfig
{
ApiKey = "your-typecast-api-key",
DefaultVoiceId = "<voice-id>",
Model = Typecast.Models.TTSModel.SsfmV30,
AudioFormat = Typecast.Models.AudioFormat.Mp3
});
public record TypecastConfig
{
public required string ApiKey { get; init; }
public string DefaultVoiceId { get; init; } = "";
public TTSModel Model { get; init; } = TTSModel.SsfmV30;
public LanguageCode? Language { get; init; }
public EmotionPreset? Emotion { get; init; }
public double? EmotionIntensity { get; init; }
public AudioFormat AudioFormat { get; init; } = AudioFormat.Mp3;
}
Property Description Default
ApiKey Your Typecast API key (required)
DefaultVoiceId Voice id used when none is supplied via TextToSpeechOptions.Voice (empty)
Model Typecast TTS model (SsfmV21, SsfmV30) SsfmV30
Language Optional language hint; null lets Typecast auto-detect from the text null
Emotion Optional emotion preset applied to every utterance null
EmotionIntensity Intensity for Emotion (≈ 0.0–2.0) null
AudioFormat Output container (Mp3, Wav) Mp3

Typecast has no fixed public default voice. Set DefaultVoiceId, or pass a voice per call via TextToSpeechOptions.Voice. Call GetVoicesAsync() to discover the voice ids available to your account.

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

public class MyViewModel(ITextToSpeechService tts)
{
async Task Speak()
{
// Discover the voices available to your account
var voices = await tts.GetVoicesAsync();
var voice = voices.FirstOrDefault();
await tts.SpeakAsync("Hello from Typecast!", new TextToSpeechOptions
{
Voice = voice,
SpeechRate = 1.2f // maps to Typecast's audio tempo
});
}
}

Typecast takes emotion out of band via the prompt object, so a portable SpeechTone becomes emotion_preset + emotion_intensity and any bracketed annotations in the text are stripped rather than spoken aloud:

await tts.SpeakAsync("We just shipped it.", new TextToSpeechOptions
{
Tone = new SpeechTone { Emotion = SpeechEmotion.Excited, Intensity = 1.5f }
});
// -> prompt: { emotion_type: "preset", emotion_preset: "happy", emotion_intensity: 1.5 }

Typecast’s preset vocabulary is normal, happy, sad, angry, whisper, toneup and tonedown, so the mapping is lossy — Excited and Friendly both land on happy, Calm and Serious on tonedown, and Fearful and Sarcastic have no analogue and fall back to TypecastConfig.Emotion.

A per-call Tone takes precedence over TypecastConfig.Emotion / EmotionIntensity, which act as the defaults for calls that don’t set one.