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 will be 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. Add the following line to your scenario code to use the function:

require(Modules.Player);

Parameters

  • text:

    string

    Text to say

  • TTSPlayerOptions:

    TTSPlayerOptions

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

Returns