Skip to main content

Manage TextToSpeech & SpeechToText Services

Manage TextToSpeech & SpeechToText Services

Use this component to access text to speech services on the device.

To get started using it, you must use KmpTextToSpeech. All functions are thread safe and main thread safe.

To convert text to speech (allows the device to translate the text into sound):


_1
KmpTextToSpeech.convertTextToSpeech(message: String)

Below are the functions available, for converting Speech to Text:


_5
KmpTextToSpeech.stopSpeechEngine() // stops speech services
_5
_5
KmpTextToSpeech.convertSpeechToText{
_5
val response = it //speech object containing the text translated from sound into physical text
_5
}

Android Setup

On android please add the following into your manifest file


_1
<uses-permission android:name="android.permission.RECORD_AUDIO" />

iOS Setup

Add the following into your device's info.plist file:


_5
<key>NSSpeechUsageDescription</key>
_5
<string>Reason for why your app needs access to speech services</string>
_5
_5
<key>NSMicrophoneUsageDescription</key>
_5
<string>Reason for why your app needs access to speech services</string>