Rate this page:

RealtimeTTSPlayer

Constructors

constructor
Copy URL

Methods

addEventListener
Copy URL
addEventListener(event: 

PlayerEvents

,
callback:

Function

):

void

Adds a handler for the specified PlayerEvents event. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler is called.

Parameters

Returns

  • type:

    void

clearBuffer
Copy URL
clearBuffer(): 

void

Clears a Deepgram.RealtimeTTSPlayer buffer and resets the provider text/audio queue. Find more information in the documentation

Returns

  • type:

    void

flush
Copy URL
flush(): 

void

Forces the Deepgram provider to process all queued text and return the final audio immediately.

Sends { type: "Flush" } to the provider. Required when the text stream is finished but the WebSocket connection should remain open. Find more information in the documentation

Returns

  • type:

    void

id
Copy URL
id(): 

string

Returns the player's id.

Returns

  • type:

    string

pause
Copy URL
pause(): 

void

Pauses playback. To continue the playback use the Player.resume method.

Returns

  • type:

    void

removeEventListener
Copy URL
removeEventListener(event: 

PlayerEvents

,
callback:

Function

):

void

Removes a handler for the specified PlayerEvents event.

Parameters

Returns

  • type:

    void

resume
Copy URL
resume(): 

void

Resumes playback after the Player.pause method is called.

Returns

  • type:

    void

sendMediaTo
Copy URL
sendMediaTo(mediaUnit: 

VoxMediaUnit

,
parameters:

SendMediaParameters

):

void

Starts sending media from the player to the media unit.

Parameters

Returns

  • type:

    void

sendText
Copy URL
sendText(parameters: 

Object

):

void

Sends a text message to the Deepgram provider Speak WebSocket connection.

Use this to append text for continuous speech generation. Find more information in the documentation.

Parameters

  • parameters:

    Object

    Object provides the parameters directly to the Deepgram provider Speak message. Find more information in the documentation

Returns

  • type:

    void

stop
Copy URL
stop(): 

void

Stops playback. The current player's instance is destroyed.

Returns

  • type:

    void

stopMediaTo
Copy URL
stopMediaTo(mediaUnit: 

VoxMediaUnit

):

void

Stops sending media from the player to the media unit.

Parameters

  • mediaUnit:

    VoxMediaUnit

    Media unit that does not need to receive media from this conference anymore

Returns

  • type:

    void

Rate this page: