This is a WebRTC-based audio streaming application using OpenAI's API, developed with Next.js under the Deno runtime. It supports real-time audio interaction with OpenAI's models.
- WebRTC Audio Streaming: Stream audio in real-time.
- OpenAI Integration: Connects to OpenAI's real-time models via their API.
- Next.js Framework: Built with Next.js for server-side rendering and API routes.
- Tailwind CSS: Styled using Tailwind CSS.
- Deno runtime
- Node.js (optional, if not using Deno)
- OpenAI API Key
Check out the tutorial for a brief explanation of WebRTC and code walkthrough.
git clone https://github.com/skrivov/openai-webrtc-audio-next.git
cd openai-webrtc-audiodocker build -t voice -f Dockerfile
docker run -d -p 3000:3000 --name voice-app -e OPENAI_API_KEY=<key> voice
- Open the app in your browser:
http://localhost:3000.
git clone https://github.com/skrivov/openai-webrtc-audio-next.git
cd openai-webrtc-audioCreate a .env file in the root directory:
OPENAI_API_KEY=your-openai-api-keyIf using Node.js:
npm installIf using Deno:
deno installnpm run devdeno task devThe application will be available at http://localhost:3000.
- Open the app in your browser:
http://localhost:3000. - Select a voice and start the audio session.
- Next.js: Framework for building React applications with server-side rendering.
- Tailwind CSS: Utility-first CSS framework for styling.
- OpenAI API: Integration with OpenAI's real-time models.
- WebRTC: Real-time communication API.
- Deno: Alternative runtime for the app.
- Fork the repository.
- Create a new branch.
- Make your changes and commit them.
- Push your branch and create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- OpenAI for their API and models.
- Next.js for the framework.
- Tailwind CSS for styling.
- Simon Willison’s Weblog for inspiration