Skip to content

ArnabTechiee/VolumeControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Hand Volume Control

πŸ“– Overview

Hand Volume Control is a Human-Computer Interaction (HCI) project that enables contactless audio management using computer vision. By leveraging OpenCV and MediaPipe, this application tracks hand landmarks in real-time to translate physical gestures into system volume commands.

This project eliminates the need for physical peripherals, offering a seamless and futuristic way to interact with media devices.


✨ Key Features

  • Real-Time Tracking: Low-latency hand detection and landmark tracking.
  • Gesture Recognition: Intuitive mapping of vertical hand movements to volume levels.
  • Mute Toggle: Quick "Fist" gesture recognition for instant muting/unmuting.
  • Cross-Platform Architecture: Designed for Windows (via Pycaw) with adaptable architecture for macOS/Linux.
  • Configurable Sensitivity: User-defined sensitivity thresholds via a JSON configuration file.

πŸ› οΈ Tech Stack

  • Language: Python 3.8+
  • Computer Vision: OpenCV (cv2), MediaPipe
  • Audio Control: Pycaw (Python Core Audio Windows Library)
  • Math/Processing: NumPy

πŸš€ Getting Started

Prerequisites

  • Hardware:
    • PC/Laptop with a working webcam (Integrated or USB).
  • Software:
    • Python 3.8 or higher installed.

Installation

  1. Clone the Repository

    git clone https://github.com/username/hand-volume-control.git
    cd hand-volume-control
  2. Set up a Virtual Environment (Optional but Recommended)

    python -m venv venv
    # Windows
    venv\Scripts\activate
    # macOS/Linux
    source venv/bin/activate
  3. Install Dependencies

    pip install -r requirements.txt

πŸ•ΉοΈ Usage

  1. Run the Application Execute the main script to start the webcam feed:

    python hand_volume_control.py
  2. Control Guide Ensure your hand is clearly visible in the camera frame (good lighting recommended).

Gesture Action Description
Move Hand Up ⬆️ Volume UP Raise your open hand vertically to increase volume.
Move Hand Down ⬇️ Volume DOWN Lower your open hand vertically to decrease volume.
Clench Fist ✊ Mute / Unmute Quickly close your hand into a fist to toggle audio.
  1. Exit Press q or Esc to close the application window.

βš™οΈ Configuration

You can fine-tune the tracking sensitivity and volume range by modifying the config.json file in the root directory.

{
  "sensitivity": 0.5,
  "camera_index": 0,
  "volume_range": [0, 100],
  "detection_confidence": 0.7
}
  • sensitivity: Adjusts the responsiveness of volume changes relative to hand movement speed.
  • camera_index: Set to 0 for default webcam, 1 for external, etc.
  • volume_range: Defines the min/max limits for the system volume.

πŸ”§ Troubleshooting

  • Camera Not Detected:
    • Ensure no other application (Zoom, Teams, etc.) is currently using the webcam.
    • Try changing the camera_index in config.json.
  • Gestures Not Recognized:
    • Ensure the environment is well-lit.
    • Keep your hand within 0.5 - 1.0 meters of the camera.
  • Audio Not Changing (Windows):
    • Verify pycaw is installed correctly.
    • Run the script as Administrator if permission issues persist.

🀝 Contributions

Contributions are always welcome! If you have ideas for new gestures or platform support (macOS/Linux):

  1. Fork the Project.
  2. Create your Feature Branch (git checkout -b feature/NewGesture).
  3. Commit your Changes (git commit -m 'Add some NewGesture').
  4. Push to the Branch (git push origin feature/NewGesture).
  5. Open a Pull Request.

πŸ“œ License

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


πŸ™Œ Acknowledgements

  • MediaPipe by Google for the robust hand-tracking architecture.
  • [Pycaw](https://github.com/ AndreMiras/pycaw) for the Windows audio control interface.
  • OpenCV for image processing utilities.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages