rohanprichard/fastrtc-demo
关于
A simple POC of FastRTC, a framework to use voice mode in python!
人工智能与机器学习实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 0
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文FastRTC Voice Demo
A reference implementation of a browser-based, real-time voice conversation experience. The repository separates a FastAPI/FastRTC backend from a Next.js frontend so the voice pipeline and interface can evolve independently.
What it demonstrates
- microphone capture and browser voice interaction
- FastRTC-powered real-time transport
- speech-to-text and text-to-speech through ElevenLabs
- LLM responses through an OpenAI-compatible API key
- tunable voice-activity detection settings
Architecture
Browser (Next.js) → FastAPI + FastRTC → STT / LLM / TTS providers
The browser UI lives in frontend/fastrtc-demo; the Python backend lives in backend/.
Run locally
1. Configure provider keys
Copy .env.example to .env and supply your own keys:
LLM_API_KEY=...
ELEVENLABS_API_KEY=...
Never commit .env or expose provider keys in a browser client.
2. Start the backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
./run.sh
On Windows, run uvicorn backend.server:app --host 0.0.0.0 --port 8000 after installing dependencies.
3. Start the frontend
cd frontend/fastrtc-demo
npm install
npm run dev
Open the local URL printed by Next.js and allow microphone access when prompted.
Voice tuning
The backend exposes voice-activity detection settings such as speech threshold, silence duration, speech padding, and maximum segment duration. Increase silence duration if the assistant interrupts too quickly; decrease it if responses feel slow.
Operational notes
This is a demonstration project. Running it requires billable third-party API credentials, HTTPS in most production microphone contexts, and a deployment design that keeps provider keys on the server.
License
MIT
探索相关项目
加载中…