TextToSpeechEngine
public protocol TextToSpeechEngine
TextToSpeechEngine provides interface of the text to speech engine.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Defines supported alphabets of the phonetic transcriptions.
Declaration
Swift
var supportedAlphabets: [String] { get } -
A delegate to respond to events that occur during playback.
Declaration
Swift
var delegate: TextToSpeechEngineDelegate? { get set } -
A locale that defines the voice’s language.
Declaration
Swift
var locale: Locale { get } -
Initializes vocalization of the message.
Declaration
Swift
func play(message: TTSMessage)Parameters
messageThe
TTSMessagethat contains text message and options, that define how the message should be handled. -
Immediately stops the playback.
Declaration
Swift
func stop() -
Sets the audio volume to one of the predefined levelas.
Declaration
Swift
func setVolume(_ volume: SpeechVolume)Parameters
volumeOne of the predefined volume levels.
-
Sets the language code of the messages.
Throws
TextToSpeechEngineError.unavailableLocaleInVoicesif there is no speech voice for the givenlocale.Declaration
Swift
func changeLocale(with locale: Locale) throwsParameters
localeThe locale to change to.
-
Checks if the specified voice’s language is available on the device.
Declaration
Swift
static func isLanguageAvailable(for locale: Locale) -> BoolParameters
localeLocale used to identify the language
Return Value
trueif the specified language is available,falseotherwise.
TomTom SDK for iOS (0.53.1)
TextToSpeechEngine