Rate this page:

createTTSPlayer

Copy URL
createTTSPlayer(text: 

string

,
parameters:

TTSPlayerParameters

):

Player

Creates a new Player (audio player) instance with specified text (TTS is used to play the text). You can attach media streams later via the Player.sendMediaTo or VoxEngine.sendMediaBetween methods. If the text length exceeds 1500 characters, the PlayerEvents.PlaybackFinished event is triggered with error description. After the very first playing, a phrase is cached; each createTTSPlayer instance stores the cache data up to 2 weeks. Note that cache addresses only the URL, without additional headers. The cached phrase is available for all applications and further sessions.

Parameters

  • text:

    string

    Text to synthesize

  • Optional

    Optional. TTS player parameters

Returns