Skip to content

hectorC/LiveKit-Classroom-Audio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiveKit Classroom Audio

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.

What you need

  • 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.

Setup

  1. Install JavaScript packages
    npm install
  2. Run the LiveKit server
    • Open Command Prompt.
    • Go to the folder with livekit-server.exe and 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.”
  3. 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.
  4. Optional: give the server a friendly name
    • On many routers you can add a “static lease” or DNS entry so that http://classroom:3000 points to the teacher computer. This saves everyone from typing the raw IP address (for example http://192.168.8.10:3000).

How to use it

  • Teacher computer

    1. 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).
    2. Click Refresh devices if the input list is empty.
    3. Pick the audio device that carries your mix (Virtual Audio Cable, USB mixer, etc.).
    4. Press Connect & Publish Audio. The page sends that input to LiveKit in high-quality stereo.
    5. The UI is a template version but with some HTML and CSS knowledge teacher.html, student.html and style.css can be customized to your desired visual design (making sure you keep the script section and key interactive elements intact).
  • Student devices

    1. Go to http://<server-ip>:3000 or the friendly name (e.g. http://classroom:3000). The home page automatically shows the listener controls.
    2. 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.

Depending on network infrastructure, up to 200 students can listen at once (you can change the limit inside classroom.yaml).

Troubleshooting

  • “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 in server.js match the ones in classroom.yaml.
  • LiveKit script missing – if you see LivekitClient is not defined, ensure public/livekit-client.umd.min.js exists. 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 see ok, 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.
    1. Open your phone’s Settings.
    2. Tap Apps.
    3. Find and select your browser (for example Chrome or Edge).
    4. Tap Battery or App battery usage.
    5. Select Unrestricted (or enable Allow background usage).

Licensing notes

  • 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.js is part of LiveKit Client, which is distributed under the Apache License 2.0. Include that license notice if you redistribute the bundle separately.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors