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.
- 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
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
git clone https://github.com/YOUR_USERNAME/Jarvis-Audio-Controller.git
cd Jarvis-Audio-Controller
pip install -r requirements.txt
Because PyAudio depends on PortAudio, installation may differ by operating system.
pip install pyaudio
If it fails:
pip install pipwin
pipwin install pyaudio
brew install portaudio
pip install pyaudio
sudo apt-get update
sudo apt-get install python3-pyaudio portaudio19-dev
Run the assistant from the terminal:
python jarvis.pyThen say the wake word:
Jarvis
The assistant will begin listening for claps.
Example:
Jarvis
*clap clap*
→ Gaming environment launched
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.
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")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.
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"
])You can connect these actions to clap counts:
if claps == 1:
open_ai_tools()
elif claps == 2:
download_mp3()
elif claps == 3:
open_discord()
- Make sure application paths are correct for your system.
- If using Chrome, ensure the
chromecommand is accessible from your system path. - Additional automation can be added using Python libraries such as:
subprocessospyautoguiyt-dlp
This makes the assistant highly customizable and adaptable to different workflows.
| Claps | Action |
|---|---|
| 1 Clap | Action 1 |
| 2 Claps | Action 2 |
| 3 Claps | Action 3 |
Jarvis-Audio-Controller
│
├── main.py
├── README.md
├── requirements.txt
└── sounds
- Better noise filtering
- Custom wake word
- GUI interface
- Smart home control
- Raspberry Pi support
Hiranya Singh
B.Tech Computer Science
NIIT University