volume-control
v1.2.4
Published
Volume control application with frontend and backend
Downloads
2
Maintainers
Readme
Volume Control Remote
A sleek, responsive web application that transforms your mobile device into a remote control for your PC's audio. Perfect for controlling volume levels of individual applications from the comfort of your couch or during presentations.
🚀 Key Features
- 📱 Mobile-first design for easy control from any device
- 🎚️ Individual volume control for all running applications
- 🔄 Real-time updates via WebSockets
- 🌐 Accessible from any device on the same network
- 🖥️ Cross-platform support (Windows & Linux)
- 🛠️ No installation required - runs in any modern web browser
📥 Download Pre-built Packages
We provide pre-built packages for easy installation. Please visit our Releases page to download the latest version for your platform.
Windows
Linux
Note: After downloading, make sure to check the release notes for any specific installation instructions.
🛠️ Installation
Windows
- Download the appropriate Windows installer
- Run the installer and follow the on-screen instructions
- The application will start automatically after installation
Linux
- Download the appropriate Linux binary
- Make it executable:
chmod +x volume-control-linux-x64 - Run the application:
./volume-control-linux-x64
🛠️ Development Setup
Prerequisites
- Node.js 18+ and npm 9+ or pnpm 8+
- Git
- (Windows) Windows Build Tools (for native modules)
- (Linux) Build essentials and Python (for node-gyp)
Getting Started
Clone the repository
git clone https://github.com/Volodymyr-Bauzi/PC-Volume-controll-using-mobile.git cd PC-Volume-controll-using-mobileInstall dependencies
# Install root dependencies npm install # Install frontend dependencies cd frontend npm install # Install backend dependencies cd ../backend npm installSet up environment variables
- Copy
.env.exampleto.env.developmentin the root directory - Update the values as needed (defaults should work for local development)
- Copy
Start the development servers
# From the root directory npm run devThis will start both the frontend (port 3000) and backend (port 3001) in development mode with hot-reload.
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
🚀 Production Setup
Prerequisites
- Node.js 18+ and npm 9+ or pnpm 8+
- (Optional) PM2 for process management
- (Optional) Nginx or similar reverse proxy for production
Building for Production
Build the application
# From the root directory npm run buildThis will build both the frontend and backend for production.
Set up environment variables
- Create a
.env.productionfile in the root directory - Configure production-specific settings (see
.env.examplefor reference) - Important: Set secure values for production (HTTPS, CORS, etc.)
- Create a
Start the production server
# From the backend directory cd backend npm startThe application will be available at the configured domain/port.
Using PM2 (Recommended for Production)
Install PM2 globally:
npm install -g pm2Start the application with PM2:
# From the backend directory cd backend pm2 start npm --name "volume-control" -- startSave the PM2 process list and set up startup script:
pm2 save pm2 startup
Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| NODE_ENV | Environment (development/production) | development |
| VITE_PORT | Frontend development server port | 3000 |
| VITE_API_PORT | Backend API port | 3001 |
| VITE_API_URL | API base URL (auto-configured) | - |
| CORS_ORIGIN | Allowed CORS origins | http://localhost:3000 |
| WS_PROTOCOL | WebSocket protocol (ws/wss) | ws (dev) / wss (prod) |
| WS_HOST | WebSocket host | localhost |
| WS_PORT | WebSocket port | 3001 |
| LOG_LEVEL | Logging level | debug (dev) / info (prod) |
🔧 Troubleshooting
Common Issues
Native module build fails
- Ensure you have the required build tools installed
- On Windows:
npm install --global --production windows-build-tools - On Ubuntu/Debian:
sudo apt-get install -y build-essential python3
Port already in use
- Check for other processes using ports 3000 or 3001
- Update the ports in
.env.developmentif needed
CORS errors
- Ensure
CORS_ORIGINis correctly set in your environment variables - In development, make sure the frontend URL matches the allowed origins
- Ensure
WebSocket connection issues
- Check that the WebSocket URL is correctly configured
- Ensure your reverse proxy (if any) is configured to handle WebSocket connections
Getting Started
Clone the repository
git clone https://github.com/Volodymyr-Bauzi/PC-Volume-controll-using-mobile.git cd PC-Volume-controll-using-mobileInstall dependencies
npm installSet up environment variables
- Copy
.env.exampleto.env.local - Modify the values as needed for your local setup
- Copy
Available Scripts
npm start- Start both frontend and backend in development modenpm run start:prod- Start in production modenpm run build- Build both frontend and backend for productionnpm run package- Package the application for distributionnpm test- Run testsnpm run lint- Run linter
Environment Variables
Key environment variables:
NODE_ENV- Environment (development, production, test)REACT_APP_API_URL- Backend API URLREACT_APP_WS_URL- WebSocket URLREACT_APP_DEBUG- Enable debug logging
🎮 Usage
Development Mode
- Start the development server:
npm start - The application will be available at
http://localhost:3000 - The backend API will be available at
http://localhost:3001
Production Mode
- Build the application:
npm run build - Start the production server:
npm run start:prod - The application will be available at
http://localhost:3000
Remote Access
- Start the application on your PC
- Open your mobile browser and navigate to the address shown in the application window
- Example:
http://192.168.1.x:3000
- Example:
- Control volume for any running application directly from your mobile device
📦 Release Packaging
To create release packages for distribution, use the included packaging script:
Build the application for all platforms:
# Build for Windows npm run package:win # Build for Linux npm run package:linuxRun the packaging script to create distribution packages:
node package-release.jsFind the packages in the
release/directory:volume-control-windows-vX.X.X.zipvolume-control-linux-vX.X.X.zip
Upload these files to your GitHub release.
🔧 Building from Source
Prerequisites
- Node.js 18+
- npm or yarn
- Windows: Visual Studio Build Tools with Windows SDK
- Linux: PulseAudio and development files
Build Steps
Clone the repository:
git clone https://github.com/yourusername/volume-control.git cd volume-controlInstall dependencies:
npm installBuild the application:
npm run packageFind the built packages in the
distdirectory
🐛 Troubleshooting
Common Issues
Can't connect from mobile device
- Ensure both devices are on the same network
- Check your firewall settings to allow connections on port 8001
No applications showing
- Make sure some applications are playing audio
- Restart the application
Linux: No sound control
- Ensure PulseAudio is running:
pulseaudio --check - Check that your user is in the
pulse-accessgroup
- Ensure PulseAudio is running:
🤝 Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
public/- Static assetspackage.json- Node.js dependencies and scripts
License
MIT
