Sometimes we need to create an application that transform our written text to speech… But why?.. Because this makes it more intuitive and dynamic also provides better usability and can help people with visual disabilities.
What is TextToSpeech Plugin?
Its a plugin that let us make the text to speech. Its supported on Xamarin Android, Xamarin.iOS, Xamarin.tvOS, Xamarin.macOS and Xamarin.Forms projects ( Below I show you the platform-versions supported ). This plugin can manage some behaviors of our text speeched, for example: Pitch, speak rate, volumen among others that I show you below.
First of all.. What do I need?
- Add from NuGet Package the plugin: Xam.Plugins.TextToSpeech:
How use it?
To use it ,we have the Speak method. This receive differents parameters to control the behavior that will get the speech text.
Paramethers / Features:
✔ Speak back text feature (TextToSpeechValue): It’s the phrase that we will convert in to a speech world.
✔ Pitch (PitchValue:) Indicates the pitch/tone that will get the speech phrase.
✔ Speak Rate (Speed Value): Controls the speed of the speech phrase.
✔ Volume (VolumeValue): Controls the volume of the speech phrase.
✔ Locale/Language of Speech: Set the language of the phrase to speech.
✔Gather all available languages to speak in: Get the language availables for use in the phrase to speech.
Good luck with your implementation! ?
Click to see an example in my GitHub.