Skip to main content

Speak

POST 

/workstations/:workstation_id/audio/speak

Play voice audio into the virtual microphone via a text-to-speech model. You must provide the exact copy for the agent to speak. The audio is played in realtime via byte streaming to reduce latency.

Interrupting Speech:

There are two ways to interrupt a speak operation already in progress:

  1. Recommended Method: Close the HTTP POST request. The /speak request keeps the connection open while the agent is speaking, and closing this connection will immediately stop the speech. A RST close packet is required to stop the speech.

    Note: NodeJS developers should use the socket.resetAndDestroy() method to close the connection via an RST close packet. It is also helpful to pause for 100ms after socket.resetAndDestroy() to ensure the RST packet is sent.

  2. Alternative Method: Make a new /speak request while an existing one is in progress. This will automatically terminate the first request and begin playing the new speech. Note that this approach may cause delays if many interruptions occur in quick succession. This method is good for simple one-off 'emergency' interruptions.

Request

Responses

No Content - the operation was successful but there is no additional content to return.