ElevenLabs + Twilio: Create an AI That Responds in Real-Time - Part 2
Автор: AyyazTech
Загружено: 2026-01-25
Просмотров: 108
Описание:
Build a fully functional AI phone agent that can actually TALK BACK! In this tutorial, we connect ElevenLabs Conversational AI to our
Twilio stream from Part 1.
📱 What You'll Build:
A bidirectional audio bridge where Twilio captures phone audio → your server forwards it to ElevenLabs → ElevenLabs transcribes,
processes with AI, and generates speech → you send the AI's voice back through Twilio to the caller.
🔗 Resources:
📁 GitHub Repo: https://github.com/ayyazzafar/ai-voic...
📖 Blog Post: https://ayyaztech.com/blog/ai-voice-a...
▶️ Part 1: • Twilio Phone Calls with Node js - AI Voice...
⏱️ Timestamps:
0:00 - Intro & Demo Preview
0:08 - Part 1 Recap: Node.js Server & Twilio WebSocket
1:39 - What We're Building Today
2:00 - How the Audio Flow Works
2:10 - Setting Up ElevenLabs Agent
2:28 - Creating a New Agent
2:45 - Configuring System Prompt
3:12 - Choosing Voice & TTS Model
3:33 - Selecting the LLM (Speed Matters!)
4:17 - ⚠️ CRITICAL: Audio Format Configuration
5:33 - Getting Agent ID & API Key
6:35 - Environment Variables Setup
6:49 - Creating elevenlabs.ts (WebSocket Connection)
8:22 - Updating index.ts (Handle Twilio Connection)
10:07 - Setting Up Bidirectional Audio Bridge
13:01 - Handling 11Labs Events (Audio, Transcripts)
14:54 - Wiring It All Together
15:01 - Testing the AI Phone Agent
16:18 - Debugging User Transcripts
18:06 - Final Working Demo
20:02 - Troubleshooting Common Issues
20:41 - Recap: What We Built
⚠️ Critical Configuration (Don't Skip!):
Both input AND output audio formats in ElevenLabs must be set to μ-law 8000 Hz:
• Advanced Settings → User Input Audio Format → μ-law 8000 Hz
• Voice Settings (gear icon) → TTS Output Format → μ-law 8000 Hz (Telephony)
🛠️ Tech Stack:
• Node.js + TypeScript
• Twilio Media Streams
• ElevenLabs Conversational AI
• WebSocket bidirectional communication
👋 Connect with me:
🌐 Website: https://ayyaztech.com
🐦 Twitter: / ayyaztech
#AI #VoiceAI #Twilio #ElevenLabs #NodeJS #TypeScript #Tutorial #Programming
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: