This project lets you send audio from one teacher computer to many listeners on the same Wi‑Fi network using WebRTC. Latency stays very low so the class hears things almost instantly.
- Node.js 18 or newer – lets Windows run the small helper server. Download from https://nodejs.org.
- LiveKit Server 1.9.6 for Windows – download the release zip/exe from https://github.com/livekit/livekit/releases.
- An audio input – this can be Virtual Audio Cable, a USB audio interface, or any input device that carries the teacher mix.
- (Optional) Router hostname – if your router can reserve a name such as
http://classroom:3000, students won’t need to type an IP address.
- Install JavaScript packages
npm install
- Run the LiveKit server
- Open Command Prompt.
- Go to the folder with
livekit-server.exeand this project. - Start LiveKit and point it to the provided config:
livekit-server --config classroom.yaml
- Leave that window open; it is the audio conference “engine.”
- Run the helper web server
- Open a second Command Prompt in the project folder.
- Start the Node.js server, which hosts the web pages and generates secure access codes:
node server.js
- Keep this window open while the class runs.
- Optional: give the server a friendly name
- On many routers you can add a “static lease” or DNS entry so that
http://classroom:3000points to the teacher computer. This saves everyone from typing the raw IP address (for examplehttp://192.168.8.10:3000).
- On many routers you can add a “static lease” or DNS entry so that
-
Teacher computer
- Visit
http://<server-ip>:3000/teacher.html(replace<server-ip>with the computer’s address, e.g.http://192.168.8.10:3000/teacher.html). - Click Refresh devices if the input list is empty.
- Pick the audio device that carries your mix (Virtual Audio Cable, USB mixer, etc.).
- Press Connect & Publish Audio. The page sends that input to LiveKit in high-quality stereo.
- The UI is a template version but with some HTML and CSS knowledge
teacher.html,student.htmlandstyle.csscan be customized to your desired visual design (making sure you keep the script section and key interactive elements intact).
- Visit
-
Student devices
- Go to
http://<server-ip>:3000or the friendly name (e.g.http://classroom:3000). The home page automatically shows the listener controls. - Tap Listen. The page grabs a one-time access code, connects to LiveKit over the local network, and starts playing audio as soon as the teacher is live.
- Go to
Depending on network infrastructure, up to 200 students can listen at once (you can change the limit inside classroom.yaml).
- “Token” errors – these are the security codes given to each browser. Make sure the Node.js window (running
node server.js) is still open, and confirm the API key/secret inserver.jsmatch the ones inclassroom.yaml. - LiveKit script missing – if you see
LivekitClient is not defined, ensurepublic/livekit-client.umd.min.jsexists. The file ships with this project so you can run without Internet access. - Can’t reach LiveKit – from a student device, open
http://<server-ip>:7880. If you seeok, the LiveKit engine is reachable. If not, check firewall rules or Wi‑Fi isolation. - Android: audio stops when the screen turns off – some Android devices will pause or throttle the browser when the phone goes to sleep (even while audio is playing). The most reliable fix is to exclude the browser from battery optimization / sleeping apps.
- Open your phone’s Settings.
- Tap Apps.
- Find and select your browser (for example Chrome or Edge).
- Tap Battery or App battery usage.
- Select Unrestricted (or enable Allow background usage).
- The UI uses the Space Grotesk font, licensed under the SIL Open Font License. Keep that license with the font if you redistribute or customize it.
- The browser bundle
livekit-client.umd.min.jsis part of LiveKit Client, which is distributed under the Apache License 2.0. Include that license notice if you redistribute the bundle separately.