Skip to content

CaringMender/Jarvis-Audio-Controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Jarvis Audio Controller

Python Platform Audio

A Python-based voice and audio automation tool that listens for a wake word ("Jarvis") followed by a series of claps. The number of claps detected determines which action is executed on the host system.

This project demonstrates real-time microphone input processing, audio spike detection, and event-based command execution using Python.

Jarvis Audio Controller supports custom automation actions such as launching applications, opening browser tabs, or downloading media files.

Note: I designed the concept and system logic for this project and used ChatGPT to assist with accelerating the implementation.


Features

  • Wake word detection ("Jarvis")
  • Clap detection using microphone input
  • Command execution based on number of claps
  • Works on any device with Python and a microphone

How It Works

Microphone Input
        ↓
Wake Word Detection ("Jarvis")
        ↓
Listening Window Opens
        ↓
Clap Detection
        ↓
Clap Counter
        ↓
Execute Command

Example interaction:

User: "Jarvis"
System: Listening for claps...

*clap clap*

System: Detected 2 claps
→ Executes assigned command

Installation

Clone Repository

git clone https://github.com/YOUR_USERNAME/Jarvis-Audio-Controller.git
cd Jarvis-Audio-Controller

Install Python Dependencies

pip install -r requirements.txt

PyAudio Installation

Because PyAudio depends on PortAudio, installation may differ by operating system.

Windows

pip install pyaudio

If it fails:

pip install pipwin
pipwin install pyaudio

macOS

brew install portaudio
pip install pyaudio

Linux

sudo apt-get update
sudo apt-get install python3-pyaudio portaudio19-dev

Usage

Run the assistant from the terminal:

python jarvis.py

Then say the wake word:

Jarvis

The assistant will begin listening for claps.

Example:

Jarvis
*clap clap*

→ Gaming environment launched

Adding Custom Actions

The Jarvis Audio Controller is designed so users can easily customize the actions triggered after the wake word and clap detection.

Actions are defined inside the Python script (jarvis.py) as functions.
You can modify existing actions or create new ones.

Each clap count can trigger a different function.

Example logic in the main loop:

if claps == 1:
    coding_setup()

elif claps == 2:
    gaming_setup()

You can replace these with your own functions.


Example Custom Actions

1. Open Applications From File Location

You can launch any application using subprocess.Popen().

Example:

def open_discord():
    subprocess.Popen(
        "C:/Users/USERNAME/AppData/Local/Discord/Update.exe --processStart Discord.exe"
    )

Or launch any .exe file:

def open_app():
    subprocess.Popen("C:/Program Files/AppFolder/app.exe")

2. Open Websites in Chrome

You can automatically open multiple browser tabs.

def open_ai_tools():
    subprocess.Popen([
        "chrome",
        "https://chat.openai.com",
        "https://claude.ai",
        "https://gemini.google.com"
    ])

You can add any websites you want.


3. Download MP3 or MP4 Files

You can use yt-dlp to download media files from YouTube or other platforms.

First install it:

pip install yt-dlp

Example function:

def download_video():
    subprocess.run([
        "yt-dlp",
        "-f",
        "best",
        "https://youtube.com/watch?v=VIDEO_ID"
    ])

Download audio only (MP3):

def download_mp3():
    subprocess.run([
        "yt-dlp",
        "-x",
        "--audio-format",
        "mp3",
        "https://youtube.com/watch?v=VIDEO_ID"
    ])

Example Integration

You can connect these actions to clap counts:

if claps == 1:
    open_ai_tools()

elif claps == 2:
    download_mp3()

elif claps == 3:
    open_discord()

Notes

  • Make sure application paths are correct for your system.
  • If using Chrome, ensure the chrome command is accessible from your system path.
  • Additional automation can be added using Python libraries such as:
    • subprocess
    • os
    • pyautogui
    • yt-dlp

This makes the assistant highly customizable and adaptable to different workflows.

Example Clap Mapping

Claps Action
1 Clap Action 1
2 Claps Action 2
3 Claps Action 3

Project Structure

Jarvis-Audio-Controller
│
├── main.py
├── README.md
├── requirements.txt
└── sounds

Possible Improvements

  • Better noise filtering
  • Custom wake word
  • GUI interface
  • Smart home control
  • Raspberry Pi support

Author

Hiranya Singh
B.Tech Computer Science
NIIT University

About

A Python-based automation tool utilizing Picovoice Porcupine for high-accuracy wake-word detection. Once "Jarvis" is triggered, the system analyzes ambient sound levels via PyAudio to count claps, executing custom OS commands like launching VS Code, AI research tabs, or gaming environments. Lightweight and extensible.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages