{"id":6088,"library":"pyobjc-framework-coremediaio","title":"PyObjC CoreMediaIO Framework","description":"PyObjC-framework-CoreMediaIO provides Python wrappers for the CoreMediaIO framework on macOS, allowing Python applications to interact with system audio and video I/O devices. This library is part of the larger PyObjC project, which frequently updates its framework bindings in conjunction with new macOS SDK releases to ensure compatibility and expose new APIs.","status":"active","version":"12.1","language":"en","source_language":"en","source_url":"https://github.com/ronaldoussoren/pyobjc","tags":["macos","objective-c","cocoa","bindings","coremediaio","multimedia"],"install":[{"cmd":"pip install pyobjc-framework-coremediaio","lang":"bash","label":"Install CoreMediaIO bindings"}],"dependencies":[{"reason":"Provides the core bridge between Python and Objective-C/macOS APIs, required by all PyObjC framework bindings.","package":"pyobjc-core"}],"imports":[{"note":"Imports the entire CoreMediaIO framework namespace.","symbol":"CoreMediaIO","correct":"import CoreMediaIO"},{"note":"Imports a specific constant from the CoreMediaIO framework. Most interactions are with C functions and constants.","symbol":"kCMIOObjectSystemObject","correct":"from CoreMediaIO import kCMIOObjectSystemObject"}],"quickstart":{"code":"import CoreMediaIO\nimport os\n\n# CoreMediaIO is a low-level C API framework, primarily dealing with constants, \n# functions, and structs. This quickstart demonstrates importing the framework \n# and accessing a fundamental system object constant to confirm setup.\n\n# Check if the kCMIOObjectSystemObject constant is available\nif hasattr(CoreMediaIO, 'kCMIOObjectSystemObject'):\n    system_object_id = CoreMediaIO.kCMIOObjectSystemObject\n    print(f\"CoreMediaIO.kCMIOObjectSystemObject found: {system_object_id}\")\nelse:\n    print(\"CoreMediaIO.kCMIOObjectSystemObject not found, framework might not be fully loaded or API changed.\")\n\n# Note: More complex interactions with CoreMediaIO (e.g., enumerating devices,\n# getting property data) typically involve Objective-C C-style function calls\n# requiring knowledge of `objc` bridge types (like pointers and structs).\n# Refer to Apple's CoreMediaIO documentation and PyObjC examples for advanced usage.","lang":"python","description":"Demonstrates how to import the CoreMediaIO framework and access a fundamental constant. Due to CoreMediaIO being a C-based API framework, complex interactions often require understanding PyObjC's handling of C functions, pointers, and structs."},"warnings":[{"fix":"Ensure your Python environment meets the `requires_python` specification (e.g., >=3.10 for PyObjC 12.1) before upgrading PyObjC.","message":"PyObjC frequently drops support for older Python versions. PyObjC 12.0 dropped support for Python 3.9; PyObjC 11.0 dropped support for Python 3.8. Always check `requires_python` metadata or release notes for compatibility.","severity":"breaking","affected_versions":"11.0+, 12.0+"},{"fix":"Review custom `__new__` and `__init__` implementations in Python subclasses of Objective-C classes. If overriding `__new__`, ensure Objective-C style `init` methods (e.g., `initWithFoo_:`) are used where appropriate.","message":"In PyObjC 10.3, the ability to call `__init__` when a Python user class implemented `__new__` was initially removed, then partially reintroduced in 10.3.1. Code relying on `__new__` provided by PyObjC still cannot use `__init__`.","severity":"breaking","affected_versions":"10.3, 10.3.1"},{"fix":"Review Python code interacting with Objective-C initializer methods, especially those dealing with `alloc`/`init` patterns, to ensure correct reference management. PyObjC 10.3 introduced a more Pythonic `Class(...)` instantiation pattern that is generally safer.","message":"PyObjC 11.1 aligned its core bridge with `clang`'s Automatic Reference Counting (ARC) documentation for Objective-C initializer methods ('init' family). These methods now correctly steal a reference to `self` and return a new reference, which may alter reference counting behavior in some existing code, particularly with `[NSObject alloc]` proxies.","severity":"breaking","affected_versions":"11.1+"},{"fix":"Update imports from `AVFoundation.AVFAudio...` to `AVFAudio...` where applicable.","message":"Starting with PyObjC 12.0, the `AVFAudio` framework was split into a separate top-level package (`AVFAudio`) instead of being merged into `AVFoundation`. While still included in the `pyobjc-framework-AVFoundation` distribution, direct imports must be updated.","severity":"breaking","affected_versions":"12.0+"},{"fix":"Update or remove code that depends on the `IMServicePlugIn` framework. Consider alternative APIs if functionality is still required.","message":"The `IMServicePlugIn` framework bindings were removed in PyObjC 10.0, as the underlying framework was deprecated by Apple in macOS 10.13 and completely removed in macOS 14.","severity":"breaking","affected_versions":"10.0+"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z","problems":[]}