Skip to content

Commit 5d0486a

Browse files
authored
Merge pull request #1008 from pipecat-ai/cutting_initial_words
Avoid cutting off the beginning of the audio
2 parents 4ff68e6 + 2a57282 commit 5d0486a

File tree

14 files changed

+1895
-0
lines changed

14 files changed

+1895
-0
lines changed
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Bot ready signaling
2+
3+
A simple Pipecat example demonstrating how to handle signaling between the client and the bot,
4+
ensuring that the bot starts sending audio only when the client is available,
5+
thereby avoiding the risk of cutting off the beginning of the audio.
6+
7+
## Quick Start
8+
9+
### First, start the bot server:
10+
11+
1. Navigate to the server directory:
12+
```bash
13+
cd server
14+
```
15+
2. Create and activate a virtual environment:
16+
```bash
17+
python3 -m venv venv
18+
source venv/bin/activate # On Windows: venv\Scripts\activate
19+
```
20+
3. Install requirements:
21+
```bash
22+
pip install -r requirements.txt
23+
```
24+
4. Copy env.example to .env and configure:
25+
- Add your API keys
26+
5. Start the server:
27+
```bash
28+
python server.py
29+
```
30+
31+
### Next, connect using the client app:
32+
33+
For client-side setup, refer to the [JavaScript Guide](client/javascript/README.md).
34+
35+
## Important Note
36+
37+
Ensure the bot server is running before using any client implementations.
38+
39+
## Requirements
40+
41+
- Python 3.10+
42+
- Node.js 16+ (for JavaScript)
43+
- Daily API key
44+
- Cartesia API key
45+
- Modern web browser with WebRTC support
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# JavaScript Implementation
2+
3+
Basic implementation using the [Pipecat JavaScript SDK](https://docs.pipecat.ai/client/js/introduction).
4+
5+
## Setup
6+
7+
1. Run the bot server. See the [server README](../../README).
8+
9+
2. Navigate to the `client/javascript` directory:
10+
11+
```bash
12+
cd client/javascript
13+
```
14+
15+
3. Install dependencies:
16+
17+
```bash
18+
npm install
19+
```
20+
21+
4. Run the client app:
22+
23+
```
24+
npm run dev
25+
```
26+
27+
5. Visit http://localhost:5173 in your browser.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>AI Chatbot</title>
8+
</head>
9+
10+
<body>
11+
<div class="container">
12+
<div class="status-bar">
13+
<div class="status">
14+
Status: <span id="connection-status">Disconnected</span>
15+
</div>
16+
<div class="controls">
17+
<button id="connect-btn">Connect</button>
18+
<button id="disconnect-btn" disabled>Disconnect</button>
19+
</div>
20+
</div>
21+
22+
<audio id="bot-audio" autoplay></audio>
23+
24+
<div class="debug-panel">
25+
<h3>Debug Info</h3>
26+
<div id="debug-log"></div>
27+
</div>
28+
</div>
29+
30+
<script type="module" src="/src/app.js"></script>
31+
<link rel="stylesheet" href="/src/style.css">
32+
</body>
33+
34+
</html>

0 commit comments

Comments
 (0)