|
Pipecat C++ Client SDK 1.0.0
Connect native apps to Pipecat bots
|
#include <pipecat/transport.h>
Public Member Functions | |
| virtual void | initialize (TransportObserver *observer)=0 |
| virtual void | connect (const nlohmann::json ¶ms)=0 |
| virtual void | disconnect ()=0 |
| virtual void | send_ready_message (const rtvi::Message &message)=0 |
| virtual void | send_message (const rtvi::Message &message)=0 |
| Sends a message to the bot. Returns right away. | |
| virtual size_t | max_message_size () const |
| The largest message, in bytes, that send_message() accepts. | |
| virtual int32_t | send_user_audio (const int16_t *frames, size_t num_frames)=0 |
| virtual int32_t | read_bot_audio (int16_t *frames, size_t num_frames)=0 |
Connects the client to a bot, e.g. over WebRTC.
Implement this to add a new transport. Only PipecatClient calls these methods, and never from inside a TransportObserver method, so connect() and disconnect() can wait for the transport's own events. It calls initialize(), connect() and disconnect() one at a time.
|
pure virtual |
Connects to the bot and returns once connected.
params are the transport's connection parameters, usually what PipecatClient::start_bot() returned. Throws InvalidTransportParamsError if they're wrong, and TransportStartError if connecting fails.
Implemented in pipecat::DailyTransport, and pipecat::WebSocketTransport.
|
pure virtual |
Disconnects from the bot and returns once disconnected. Does nothing if not connected.
Implemented in pipecat::DailyTransport, and pipecat::WebSocketTransport.
|
pure virtual |
Prepares the transport. Called once, before anything else, with the observer to send events to.
Implemented in pipecat::DailyTransport, and pipecat::WebSocketTransport.
|
inlinevirtual |
The largest message, in bytes, that send_message() accepts.
Reimplemented in pipecat::WebSocketTransport.
|
pure virtual |
Reads up to num_frames frames of 16-bit PCM bot audio into frames. Returns the number of frames read.
Implemented in pipecat::DailyTransport, and pipecat::WebSocketTransport.
|
pure virtual |
Sends a message to the bot. Returns right away.
Implemented in pipecat::DailyTransport, and pipecat::WebSocketTransport.
|
pure virtual |
Sends the client-ready message.
Send it as soon as the bot can receive it, which may be after connect() returns (e.g. once the bot's audio starts). You can add details about the transport to the message.
Implemented in pipecat::DailyTransport, and pipecat::WebSocketTransport.
|
pure virtual |
Sends num_frames frames of 16-bit PCM user audio to the bot. Returns the number of frames sent.
Implemented in pipecat::DailyTransport, and pipecat::WebSocketTransport.