Pipecat C++ Client SDK 1.0.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_DAILY_TRANSPORT_H
11#define PIPECAT_DAILY_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
26 uint32_t user_audio_sample_rate = 16000;
30 uint32_t bot_audio_sample_rate = 16000;
32 uint8_t bot_audio_channels = 1;
33};
34
43class DailyTransport : public Transport {
44 public:
46 explicit DailyTransport(DailyTransportOptions options = {});
47
49 ~DailyTransport() override;
50
53
56
58 void initialize(TransportObserver* observer) override;
59
66 void connect(const nlohmann::json& params) override;
67
69 void disconnect() override;
70
72 void send_ready_message(const rtvi::Message& message) override;
73
75 void send_message(const rtvi::Message& message) override;
76
83 int32_t send_user_audio(const int16_t* frames, size_t num_frames) override;
84
89 int32_t read_bot_audio(int16_t* frames, size_t num_frames) override;
90
91 private:
92 class Impl;
93 std::unique_ptr<Impl> _impl;
94};
95
96} // namespace pipecat
97
98#endif
Definition transport.h:43
DailyTransport(DailyTransportOptions options={})
Creates a transport.
void connect(const nlohmann::json &params) override
~DailyTransport() override
Disconnects if needed.
int32_t send_user_audio(const int16_t *frames, size_t num_frames) override
DailyTransport & operator=(const DailyTransport &)=delete
Transports can't be copied.
void send_ready_message(const rtvi::Message &message) override
Sends the client-ready message once the bot's audio is playing.
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 Daily.
DailyTransport(const DailyTransport &)=delete
Transports can't be copied.
void disconnect() override
Leaves the room.
Definition transport.h:54
Definition transport.h:88
The Pipecat C++ client SDK.
Definition client.h:29
Options to create a DailyTransport.
Definition transport.h:24
uint8_t user_audio_channels
Number of channels of the user audio you send.
Definition transport.h:28
uint32_t bot_audio_sample_rate
Sample rate of the bot audio you read, in Hz.
Definition transport.h:30
uint8_t bot_audio_channels
Number of channels of the bot audio you read.
Definition transport.h:32
uint32_t user_audio_sample_rate
Sample rate of the user audio you send, in Hz.
Definition transport.h:26
Definition messages.h:280