Advertisement
Python253

disable_speech_recog

Mar 21st, 2024
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. # Filename: disable_speech_recog.py
  3. # Version: 1.00
  4. # Author: Jeoi Reqi
  5.  
  6. """
  7. DISABLE SPEECH RECOGNITION:
  8.  
  9. This script disables speech recognition in Windows.
  10.  
  11. Requirements:
  12. - Windows operating system
  13.  
  14. Usage:
  15. - Run the script to disable speech recognition.
  16.  
  17. Notes:
  18. - This script uses PowerShell to disable speech recognition.
  19. """
  20.  
  21. import subprocess
  22.  
  23. def disable_speech_recognition():
  24.     """
  25.    Disable speech recognition in Windows.
  26.    """
  27.     try:
  28.         # Run PowerShell command to disable speech recognition
  29.         powershell_command = 'Set-WinUserLanguageList -LanguageList en-US -Force'
  30.         subprocess.run(['powershell', '-Command', powershell_command], check=True)
  31.         print("Speech recognition disabled successfully.")
  32.     except subprocess.CalledProcessError as e:
  33.         print("Error:", e)
  34.         print("Output:", e.output)
  35.  
  36. if __name__ == "__main__":
  37.     disable_speech_recognition()
  38.  
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement