TurnDetector
Constructors
Methods
addEventListener(event: , 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
event:
Event class (i.e., Pipecat.TurnEvents.Result)
callback:
Function
Handler function. A single parameter is passed - object with event information
Returns
type:
void
close(): void
Closes the TurnDetector connection (over WebSocket) or connection attempt.
Returns
type:
void
id(): string
Returns the TurnDetector id.
Returns
type:
string
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(event: , callback: Function
): void
Removes a handler for the specified Pipecat.TurnEvents event.
Parameters
event:
Event class (i.e., Pipecat.TurnEvents.Result)
callback:
Function
OptionalOptional. Handler function. If not specified, all handler functions are removed
Returns
type:
void
reset(): void
Reset the TurnDetector context.
Returns
type:
void
webSocketId(): string
Returns the TurnDetector WebSocket id.
Returns
type:
string