How do you implement text-to-speech or speech features in MAUI?
Short answer
Use TextToSpeech.Default.SpeakAsync for TTS with options (locale, pitch, volume). For speech-to-text you'll need platform speech recognition behind an interface or a plugin, requesting microphone/speech permissions.
Advertisement
AModel answer
Use TextToSpeech.Default.SpeakAsync for TTS with options (locale, pitch, volume). For speech-to-text you'll need platform speech recognition behind an interface or a plugin, requesting microphone/speech permissions. TTS is cross-platform out of the box; recognition typically requires platform code.
await TextToSpeech.Default.SpeakAsync("Your order shipped",
new SpeechOptions { Pitch = 1.0f, Volume = 0.8f });Real-world example
An accessibility feature reads notifications aloud using built-in TextToSpeech.
Likely follow-ups
- Is speech-to-text built in? | What options does SpeakAsync accept?
Related topics