TextToSpeech

public protocol TextToSpeech : AnyObject

TextToSpeech manages the TTS engine.

Important

This is a Public Preview API. It may be changed or removed at any time.
  • Replaces the current instance of the TextToSpeechEngine with a new one.

    Declaration

    Swift

    func changeTTsEngine(to ttsEngine: TextToSpeechEngine)
  • Replaces the locale of the TextToSpeechEngine with a new one.

    Throws

    TextToSpeechEngineError.unavailableLocaleInVoices if there is no speech voice for the given locale.

    Declaration

    Swift

    func changeLanguage(locale: Locale) throws
  • Play the message.

    Declaration

    Swift

    func play(message: TTSMessage, priority: TTSMessagePriority)
  • Stop playing the voice message.

    Declaration

    Swift

    func stop()
  • Set the speech volume.

    Declaration

    Swift

    func setVolume(_ volume: SpeechVolume)