Skip to content

longlwu2000/spatial-audio

Repository files navigation

This is a demo of spatial audio using LiveKit. Users join a little 2D world, and hear other users' audio in stereo, based on their position and distance relative to you.

This is a Next.js project bootstrapped with create-next-app.

Running locally

Clone the repo and install dependencies:

git clone git@github.com:livekit-examples/spatial-audio.git
cd spatial-audio
npm install

Create a new LiveKit project at http://cloud.livekit.io. Then create a new key in your project settings.

Create a new file at spatial-audio/.env.development and add your new API key and secret as well as your project's WebSocket URL (found at the top of http://cloud.livekit.io):

LIVEKIT_API_KEY=<your api key>
LIVEKIT_API_SECRET=<your api secret>
LIVEKIT_WS_URL=wss://<your-project>.livekit.cloud

(Note: this file is in .gitignore. Never commit your API secret to git.)

Then run the development server:

npm run dev

You can test it by opening http://localhost:3000 in a browser.

Deploying for production

This project is a Next.js app. Refer to the Next.js deployment documentation for production deployment.

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.1%
  • Other 0.9%