Pipecat C++ Client SDK 1.3.0
Connect native apps to Pipecat bots
Loading...
Searching...
No Matches
transport.h
Go to the documentation of this file.
1//
2// Copyright (c) 2024-2026, Daily
3//
4// SPDX-License-Identifier: BSD-2-Clause
5//
6
9
10#ifndef PIPECAT_SMALLWEBRTC_TRANSPORT_H
11#define PIPECAT_SMALLWEBRTC_TRANSPORT_H
12
13#include <pipecat/transport.h>
14
15#include <nlohmann/json.hpp>
16
17#include <cstddef>
18#include <cstdint>
19#include <memory>
20
21namespace pipecat {
22
34
48 public:
51
54
57
60
62 void initialize(TransportObserver* observer) override;
63
66 void set_start_bot_params(const APIRequest& request) override;
67
87 void connect(const nlohmann::json& params) override;
88
90 void disconnect() override;
91
93 void send_ready_message(const rtvi::Message& message) override;
94
96 void send_message(const rtvi::Message& message) override;
97
105 int32_t send_user_audio(const int16_t* frames, size_t num_frames) override;
106
116 int32_t read_bot_audio(int16_t* frames, size_t num_frames) override;
117
118 private:
119 class Impl;
120 std::unique_ptr<Impl> _impl;
121};
122
123} // namespace pipecat
124
125#endif
Definition transport.h:47
void disconnect() override
Closes the connection.
void connect(const nlohmann::json &params) override
int32_t read_bot_audio(int16_t *frames, size_t num_frames) override
void send_message(const rtvi::Message &message) override
Sends a message to the bot.
void initialize(TransportObserver *observer) override
Prepares the transport.
~SmallWebRTCTransport() override
Disconnects if needed.
SmallWebRTCTransport(const SmallWebRTCTransport &)=delete
Transports can't be copied.
SmallWebRTCTransport & operator=(const SmallWebRTCTransport &)=delete
Transports can't be copied.
void send_ready_message(const rtvi::Message &message) override
Sends the client-ready message.
int32_t send_user_audio(const int16_t *frames, size_t num_frames) override
SmallWebRTCTransport(SmallWebRTCTransportOptions options={})
Creates a transport.
void set_start_bot_params(const APIRequest &request) override
Definition transport.h:56
Definition transport.h:91
The Pipecat C++ client SDK.
Definition client.h:29
Definition client.h:223
Options to create a SmallWebRTCTransport.
Definition transport.h:24
uint32_t user_audio_sample_rate
Sample rate of the user audio you send, in Hz.
Definition transport.h:26
uint32_t bot_audio_sample_rate
Sample rate of the bot audio you read, in Hz.
Definition transport.h:30
uint8_t user_audio_channels
Number of channels of the user audio you send.
Definition transport.h:28
uint8_t bot_audio_channels
Number of channels of the bot audio you read.
Definition transport.h:32
Definition messages.h:379