Rate this page:

TurnDetector

Constructors

constructor
Copy URL

Methods

addEventListener
Copy URL
addEventListener(event: 

TurnEvents

,
callback:

Function

):

void

Adds a handler for the specified Pipecat.TurnEvents 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

close
Copy URL
close(): 

void

Closes the TurnDetector connection (over WebSocket) or connection attempt.

Returns

  • type:

    void

id
Copy URL
id(): 

string

Returns the TurnDetector id.

Returns

  • type:

    string

predict
Copy URL
predict(): 

void

Triggers the TurnDetector to analyze the current audio and make a prediction. The result is returned in the Pipecat.TurnEvents.Result event.

Returns

  • type:

    void

removeEventListener
Copy URL
removeEventListener(event: 

TurnEvents

,
callback:

Function

):

void

Removes a handler for the specified Pipecat.TurnEvents event.

Parameters

Returns

  • type:

    void

reset
Copy URL
reset(): 

void

Reset the TurnDetector context.

Returns

  • type:

    void

webSocketId
Copy URL
webSocketId(): 

string

Returns the TurnDetector WebSocket id.

Returns

  • type:

    string

Rate this page: