Skip to content

BotolMehedi/Control-PC-Volume-from-Any-Network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Control PC Volume from Any Network

Status Version Platform License

Control your PC volume and media playback from your phone using a secure PIN, QR auto-connect, and a public tunnel that works across different networks.

This project includes a resilient local server with auto-reconnect logic for tunnel drops, so your remote control link stays available much longer without manual restarts.


Overview

This app has two parts:

  1. PC App (Node.js server): runs on your computer and controls system audio/media.
  2. Web App (mobile UI): open on phone and connect using QR + PIN.

Works over:

  1. Same Wi-Fi network.
  2. Different networks (4G/5G/Wi-Fi) through localtunnel.

Why This Project Exists

This project was built to solve a simple real problem: controlling PC sound is often inconvenient when you are away from your keyboard.

Why this is useful:

  1. You are watching movies/music on PC from bed and do not want to get up for volume changes.
  2. Your PC is connected to speakers/TV in another room.
  3. You want quick media control from phone during meetings, presentations, or streaming.
  4. You need remote access even when phone and PC are not on the same Wi-Fi.

When to use it:

  1. Home media setup (PC as media hub).
  2. Small office/presentation environments.
  3. Personal automation projects where lightweight remote sound control is needed.

In short, this project turns your phone into a practical remote control for PC audio and playback, with secure PIN access and reconnect-safe behavior.


Features

  1. QR-based auto connect flow.
  2. 4-digit PIN authentication.
  3. Live volume read and control.
  4. Mute/unmute toggle.
  5. Media keys: previous, play/pause, next.
  6. Tunnel auto-reconnect with retry strategy.
  7. Heartbeat monitoring to recover stale tunnel sessions.
  8. Auto-restart batch launcher for long-running use.

Tech Stack

  1. Backend: Node.js, Express, localtunnel, loudness.
  2. Frontend: HTML, CSS, JavaScript, Bootstrap, html5-qrcode.
  3. OS Integration: PowerShell media key events on Windows.

Setup

1) Install dependencies

From the project root:

cd pc-app
npm install

2) Start the PC server

Double click start-app.bat or run:

start-app.bat

You will see:

  1. A QR code in the terminal.
  2. A PIN code.
  3. A public URL generated by localtunnel.

3) Connect from phone

  1. Open the web app URL generated by localtunnel.
  2. Enter the PIN.
  3. Control volume and media.

Stability Notes

This project now includes:

  1. Tunnel close/error recovery.
  2. Health-check heartbeat every 30 seconds.
  3. Automatic tunnel rebuild if heartbeat fails repeatedly.
  4. Auto-restart loop in start-app.bat if Node process exits.

If your tunnel subdomain is busy, it automatically falls back to a random URL.

Optional custom subdomain:

set SC_TUNNEL_SUBDOMAIN=my-sound-control
start-app.bat

Troubleshooting

  1. QR/PIN not visible: Keep the start-app.bat window open (minimized is okay).
  2. Phone shows disconnected: Wait a few seconds for auto-reconnect, then rescan QR if tunnel URL changed.
  3. Media keys do not respond: Try running terminal as normal desktop user session (not service/remote context).
  4. Port 3000 already in use: Close conflicting app or change port in pc-app/index.js.

Security

  1. Access is guarded by a 4-digit session PIN.
  2. PIN is regenerated each time server starts.
  3. Protected routes require x-auth-pin header.

For stronger security, keep usage limited to trusted devices.


💡 Feature Requests

Have an idea? We'd love to hear it:

  1. Check existing requests
  2. Create a new issue with:
    • Detailed description
    • Use case explanation
    • Potential implementation ideas

🤝 Contributing

I built this for myself, but I'd love to see what you can add! Here's how to contribute:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request🎯

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

TL;DR: You can use this freely, modify it, sell it, whatever. Just don't blame me if something ______!😪


⚠️ Disclaimer

This tool is created for educational and research purposes only. Do not use it for any illegal activities. The creator is not responsible for any misuse, damage, or legal consequences caused by the use of this tool. By using this project, you agree that you are doing so at your own risk and for learning purposes only.


🌟 Star this repo if you find it helpful!

Portfolio | Email | Github

Made with ❤️ and lots of 💦 by BotolMehedi

About

Remotely control your PC’s volume and media playback from any device using network communication across different IPs. Built for flexibility and simplicity, this tool helps you manage audio and media functions without needing direct access to your computer.

Topics

Resources

Stars

Watchers

Forks

Contributors