{"library":"pyobjc-framework-speech","title":"PyObjC Speech Framework","description":"PyObjC-framework-Speech provides Python wrappers for the macOS Speech framework, enabling features like speech recognition. It's part of the PyObjC project, which bridges Python and Objective-C, and typically updates alongside macOS SDK releases, ensuring compatibility with the latest system features.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install pyobjc-framework-speech"],"cli":null},"imports":["from Speech import SFSpeechRecognizer","from Speech import SFSpeechRecognitionRequest","from Speech import SFSpeechRecognizerAuthorizationStatusAuthorized","from Foundation import NSLocale"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import objc\nfrom Foundation import NSLog, NSLocale\nfrom Speech import SFSpeechRecognizer, SFSpeechRecognizerAuthorizationStatusAuthorized, SFSpeechRecognizerAuthorizationStatusNotDetermined\n\ndef check_speech_recognizer_availability():\n    # Check authorization status\n    status = SFSpeechRecognizer.authorizationStatus()\n    if status == SFSpeechRecognizerAuthorizationStatusNotDetermined:\n        NSLog(\"Speech recognition authorization status: Not Determined. Requesting access...\")\n        # This will present a permission dialog to the user. The callback will be invoked.\n        # In a full app, you'd handle the response asynchronously.\n        SFSpeechRecognizer.requestAuthorization_(lambda new_status: NSLog(f\"New authorization status: {new_status}\"))\n    elif status != SFSpeechRecognizerAuthorizationStatusAuthorized:\n        NSLog(f\"Speech recognition authorization denied or restricted: {status}\")\n        return\n\n    # Create a recognizer for the default locale\n    recognizer = SFSpeechRecognizer.alloc().init()\n    if recognizer:\n        NSLog(f\"SFSpeechRecognizer available: {recognizer.isAvailable()}\")\n        NSLog(f\"Supported locales: {[locale.localeIdentifier() for locale in recognizer.supportedLocales()]}\")\n    else:\n        NSLog(\"Failed to create SFSpeechRecognizer. Ensure device supports speech recognition.\")\n\nif __name__ == \"__main__\":\n    # For permission requests to fully process and callbacks to fire reliably in a script,\n    # a Cocoa event loop is often necessary.\n    check_speech_recognizer_availability()\n    # For interactive scripts, uncomment the following lines to run a small event loop:\n    # from PyObjCTools import AppHelper\n    # AppHelper.runConsoleEventLoop(installInterrupt=True)","lang":"python","description":"Checks the authorization status for speech recognition, requests it if not determined, and then initializes an `SFSpeechRecognizer` to check its availability and supported locales. Note that a full PyObjC application typically runs within an event loop to handle UI interactions and asynchronous callbacks properly. Running this script directly will trigger the permission dialog, but a `PyObjCTools.AppHelper.runConsoleEventLoop` might be needed for the callback to be fully processed if the script exits too quickly.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":null,"pypi_latest":"12.1","is_stale":null,"summary":{"python_range":"3.10–3.9","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pyobjc-framework-speech","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pyobjc-framework-speech","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyobjc-framework-speech","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pyobjc-framework-speech","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pyobjc-framework-speech","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pyobjc-framework-speech","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.9,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pyobjc-framework-speech","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pyobjc-framework-speech","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.5,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pyobjc-framework-speech","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pyobjc-framework-speech","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.5,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}