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 }
  • Initializes vocalization of the message.

    Declaration

    Swift

    func play(message: TTSMessage)

    Parameters

    message

    The TTSMessage that 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 levels.

    Declaration

    Swift

    func setVolume(_ volume: SpeechVolume)

    Parameters

    volume

    One of the predefined volume levels.

  • Sets the language code of the messages.

    Declaration

    Swift

    func changeLanguage(languageCode: String)

    Parameters

    languageCode

    A BCP 47 language code.