AndroidTextToSpeechEngine

TextToSpeechEngine implementation based on Android's TextToSpeech.

Important: This is a Public Preview API. It may be changed or removed at any time.

Constructors

Link copied to clipboard
constructor(context: Context, language: Locale = LocaleProvider.preferredLocale())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Supported phonetic alphabets. This engine supports only IPA_PHONETIC_ALPHABET.

Functions

Link copied to clipboard
open override fun addOnEngineReadyListener(listener: OnEngineReadyListener)
Link copied to clipboard
open override fun changeLanguage(language: Locale)
Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun currentLanguage(): Locale?
Link copied to clipboard
open override fun isLanguageAvailable(language: Locale): Boolean
Link copied to clipboard
open override fun playAudioMessage(audioMessage: AudioMessage, playbackListener: MessagePlaybackListener)

Synthesizes an audio message. If another audioMessage is currently being processed this one will be added to the queue. If there is already another AudioMessages in the queue it will be flushed and replaced by this one.

Link copied to clipboard
open override fun playTaggedMessage(taggedMessage: TaggedMessage, playbackListener: MessagePlaybackListener)

Synthesizes a tagged message. TaggedMessage is parsed into MessageType.Ssml format prior to being synthesized. PhoneticAlphabetNotSupportedError is thrown if an unsupported phonetic alphabet is used.

Link copied to clipboard
Link copied to clipboard
open override fun stopMessagePlayback()

Stops synthesis of current AudioMessage and discards all messages in the queue.