Rate this page:

createTTSPlayer

Copy URL
createTTSPlayer(text: 

string

,
ttsPlayerOptions:

TTSPlayerOptions

):

Player

Create new audio player with specified text; TTS is used to play this text. Media streams can later be attached using the Call.sendMediaTo method etc. If 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 say

  • ttsPlayerOptions:

    TTSPlayerOptions

    Parameters for TTS: language, progressive playback, volume, rate, etc.

Returns