File size: 385 Bytes
f7f801d | 1 2 3 4 5 6 7 8 9 10 11 12 | """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.")
|