Skip to content

creativoma/jarvis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jarvis

Say "Hola Jarvis" → voice response → your song plays.

Runs in the background from the moment you turn on your laptop.


Prerequisites

  • macOS (uses say for voice and launchctl for auto-start)
  • Python 3.9+
  • Microphone

Getting started

1. Clone the repo

git clone https://github.com/creativoma/jarvis.git
cd jarvis

2. Create a virtual environment and install dependencies

python3 -m venv venv
source venv/bin/activate
pip install sounddevice numpy vosk

3. Download the Spanish voice model

curl -LO https://alphacephei.com/vosk/models/vosk-model-small-es-0.42.zip
unzip vosk-model-small-es-0.42.zip
rm vosk-model-small-es-0.42.zip

4. Grant microphone permission (required)

Run the script once from Terminal so macOS can show the microphone permission dialog:

venv/bin/python3 index.py

When the dialog appears asking "Python wants to access the microphone", click OK. You can stop the script with Ctrl+C after granting permission.

Why is this step required? macOS blocks microphone access for background processes (launchd agents) because they can't show permission dialogs. You need to grant the permission at least once from a terminal session. The permission is tied to the Python binary, so the background service will reuse it automatically.

5. Say "Hola Jarvis" and you're good to go.


Auto-start on login (macOS)

Edit com.jarvis.welcome.plist and replace /path/to/jarvis with the absolute path to your cloned repo (e.g. /Users/yourname/projects/jarvis). Then copy and load it:

cp com.jarvis.welcome.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.jarvis.welcome.plist

To stop it:

launchctl unload ~/Library/LaunchAgents/com.jarvis.welcome.plist

To reload after changes:

launchctl unload ~/Library/LaunchAgents/com.jarvis.welcome.plist
launchctl load ~/Library/LaunchAgents/com.jarvis.welcome.plist

Check logs in real time:

tail -f /tmp/jarvis-welcome.log
tail -f /tmp/jarvis-welcome-error.log

Troubleshooting

"Hola Jarvis" is not being detected

  1. Make sure you ran venv/bin/python3 index.py from Terminal at least once and accepted the microphone permission dialog.
  2. Check the service is running: launchctl list | grep jarvis — the PID column should show a number.
  3. Check the logs: cat /tmp/jarvis-welcome.log — you should see Listening… say «Hola Jarvis».
  4. If you revoked or reset microphone permissions (e.g. via System Settings → Privacy), repeat step 4 of Getting started.

Service is running but logs are empty

The plist includes -u (unbuffered) and PYTHONUNBUFFERED=1. If you have an older copy of the plist, reload it:

cp com.jarvis.welcome.plist ~/Library/LaunchAgents/
launchctl unload ~/Library/LaunchAgents/com.jarvis.welcome.plist
launchctl load ~/Library/LaunchAgents/com.jarvis.welcome.plist

Customization

In index.py:

Variable Description
WAKE_WORD Word that triggers Jarvis (default: "jarvis")
YOUTUBE_URL Song to open
MENSAJE What Jarvis says when activated

Credits

Inspired by RafaTatay's Jarvis project — saw it on his social media and had to build my own version.


License

MIT © Mariano Alvarez

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages