Advertisement
Python253

enable_speech_recog

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