TextToSpeechProtocol

public protocol TextToSpeechProtocol : 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 language code of the TextToSpeechEngine with a new one.

    Declaration

    Swift

    func changeLanguage(languageCode: String)
  • Play the message.

    Declaration

    Swift

    func play(message: TTSMessage, priority: TTSMessagePriority)

    Parameters

    message

    Message to play.

    priority

    Message priority with timeout.

  • Stop playing the voice message.

    Declaration

    Swift

    func stop()
  • Set the speech volume.

    Declaration

    Swift

    func setVolume(_ volume: SpeechVolume)