JARVIS / request_mic.py
Khanna, Videh Rakesh Rakesh
JARVIS v2 — full system control, battery efficient, multi-platform
f7f801d
raw
history blame contribute delete
385 Bytes
"""Run this once to trigger macOS microphone permission dialog."""
import speech_recognition as sr
print("Requesting microphone access...")
print("If you see a macOS popup, click ALLOW.")
print()
mic = sr.Microphone()
rec = sr.Recognizer()
with mic as source:
rec.adjust_for_ambient_noise(source, duration=2)
print("Microphone access GRANTED!")
print("You can close this window.")