Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gbaeke/realtime-webrtc
OpenAI realtime audio with WebRTC
https://github.com/gbaeke/realtime-webrtc
audio openai webrtc
Last synced: about 6 hours ago
JSON representation
OpenAI realtime audio with WebRTC
- Host: GitHub
- URL: https://github.com/gbaeke/realtime-webrtc
- Owner: gbaeke
- Created: 2024-12-19T11:18:24.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-01-01T16:26:48.000Z (about 1 month ago)
- Last Synced: 2025-01-01T17:30:17.651Z (about 1 month ago)
- Topics: audio, openai, webrtc
- Language: HTML
- Homepage:
- Size: 7.81 KB
- Stars: 3
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenAI Real-time WebRTC Demo
A real-time audio chat application using OpenAI's realtime audio API with WebRTC. Ask about the weather in any location and get real-time responses using Open-Meteo API.
## Features
- Real-time audio streaming
- Live transcription
- Weather function integration
- WebRTC communication
- FastAPI backend to get a ephemeral session token and to get weather data## Setup
1. Clone the repository
2. Create a virtual environment: `python -m venv .venv`
3. Activate it:
- Windows: `.venv\Scripts\activate`
- Unix/macOS: `source .venv/bin/activate`
4. Install dependencies: `pip install -r requirements.txt`
5. Create `.env` file with your OpenAI API key:```bash
OPENAI_API_KEY=your-key-here
```## Running
1. Start server: `python app.py`
2. Open index.html in a browser (Tip: use live server extension for VSCode)
3. Click Start and allow microphone access
4. Try asking: "What's the weather like in Amsterdam?"## Files
- app.py: FastAPI backend server
- index.html: Frontend interface
- requirements.txt: Python dependencies
- test.http: API endpoint tests
- .env: Environment variables (create this)## Notes
- For development use only
- Never commit your .env file
- Requires OpenAI API key
- Uses Open-Meteo API for weather data