|
Pipecat C++ Client SDK 1.0.0
Connect native apps to Pipecat bots
|
#include <pipecat/daily/transport.h>
Public Member Functions | |
| DailyTransport (DailyTransportOptions options={}) | |
| Creates a transport. | |
| ~DailyTransport () override | |
| Disconnects if needed. | |
| DailyTransport (const DailyTransport &)=delete | |
| Transports can't be copied. | |
| DailyTransport & | operator= (const DailyTransport &)=delete |
| Transports can't be copied. | |
| void | initialize (TransportObserver *observer) override |
| Prepares Daily. | |
| void | connect (const nlohmann::json ¶ms) override |
| void | disconnect () override |
| Leaves the room. | |
| void | send_ready_message (const rtvi::Message &message) override |
Sends the client-ready message once the bot's audio is playing. | |
| void | send_message (const rtvi::Message &message) override |
| Sends a message to the bot. | |
| int32_t | send_user_audio (const int16_t *frames, size_t num_frames) override |
| int32_t | read_bot_audio (int16_t *frames, size_t num_frames) override |
Public Member Functions inherited from pipecat::Transport | |
| virtual size_t | max_message_size () const |
| The largest message, in bytes, that send_message() accepts. | |
Connects to Pipecat bots over Daily (WebRTC).
Give it to PipecatClientOptions::transport. To connect, it needs the URL of the bot's Daily room, and a token if the room needs one. Start endpoints like Pipecat Cloud return both, as dailyRoom and dailyToken.
You can use several at the same time, e.g. one per client to talk to several bots.
|
overridevirtual |
Joins the bot's Daily room.
params has the room URL in url (or dailyRoom or room_url), and the token, if the room needs one, in token (or dailyToken). Throws InvalidTransportParamsError if there's no URL, and TransportStartError if joining fails.
Implements pipecat::Transport.
|
overridevirtual |
Leaves the room.
Implements pipecat::Transport.
|
overridevirtual |
Prepares Daily.
Implements pipecat::Transport.
|
overridevirtual |
Reads up to num_frames frames of 16-bit PCM bot audio, in the format of the options. Waits until there's audio to read, or until the transport disconnects. Returns the number of frames read, or 0 if it disconnected.
Implements pipecat::Transport.
|
overridevirtual |
Sends a message to the bot.
Implements pipecat::Transport.
|
overridevirtual |
Sends the client-ready message once the bot's audio is playing.
Implements pipecat::Transport.
|
overridevirtual |
Sends num_frames frames of 16-bit PCM user audio, in the format of the options. Returns the number of frames sent.
Send the audio continuously, as it's captured, and send silence while the user is muted: the bot needs it to tell when the user stops speaking. The audio is sent as is, without echo cancellation.
Implements pipecat::Transport.