{"id":5406,"library":"pyobjc-framework-coreaudio","title":"PyObjC CoreAudio Framework","description":"PyObjC is a bridge between Python and Objective-C, enabling Python scripts to interact with Objective-C class libraries, including Apple's Cocoa frameworks. This `pyobjc-framework-coreaudio` package provides Python wrappers for the macOS CoreAudio framework. It is actively maintained with frequent releases, often aligning with new macOS SDK versions and updates to supported Python versions.","status":"active","version":"12.1","language":"en","source_language":"en","source_url":"https://github.com/ronaldoussoren/pyobjc","tags":["macos","audio","coreaudio","objective-c","pyobjc"],"install":[{"cmd":"pip install pyobjc-framework-coreaudio","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core PyObjC bridge functionality","package":"pyobjc-core","optional":false},{"reason":"Base Cocoa framework bindings, typically required by other frameworks","package":"pyobjc-framework-cocoa","optional":false}],"imports":[{"symbol":"CoreAudio","correct":"import CoreAudio"}],"quickstart":{"code":"# The CoreAudio framework is very low-level and lacks simple Python examples.\n# Refer to Apple's CoreAudio documentation for usage, as its API is complex.\n# import CoreAudio\n# e.g., to get a list of audio devices (this is conceptual and untested):\n# try:\n#     from CoreAudio import AudioObjectGetPropertyData, AudioObjectPropertyAddress\n#     from CoreAudio import kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster\n#     from CoreAudio import AudioHardwareGetPropertyInfo, AudioHardwareGetProperty\n#     # ... (complex setup involving structs, callbacks, etc. not suitable for quickstart)\n#     print(\"CoreAudio imported, but direct usage is complex.\")\n# except ImportError:\n#     print(\"Could not import CoreAudio. Ensure pyobjc-framework-coreaudio is installed on macOS.\")","lang":"python","description":"Due to the low-level and C-centric nature of the CoreAudio framework, PyObjC does not provide simple Python examples for its usage. The official PyObjC documentation advises consulting Apple's CoreAudio documentation for guidance. Directly implementing CoreAudio functionality often involves complex C structures and callbacks, making a straightforward 'quickstart' difficult to provide."},"warnings":[{"fix":"Upgrade your Python environment to version 3.10 or newer.","message":"Python 3.9 support was dropped in PyObjC 12.0. While some packaging metadata in 12.1 may have incorrectly indicated Python 3.9 support, it is not officially supported.","severity":"breaking","affected_versions":">=12.0"},{"fix":"Upgrade your Python environment to Python 3.9 or newer (ideally 3.10+ due to subsequent drops).","message":"Python 3.8 support was dropped in PyObjC 11.0.","severity":"breaking","affected_versions":">=11.0"},{"fix":"Adjust import statements from `from AVFoundation import AVFAudio` to `import AVFAudio` (or `from AVFAudio import ...`).","message":"The `AVFAudio` package, previously merged into `AVFoundation`, was split into its own top-level package starting from PyObjC 12.0. Users must now import `AVFAudio` directly.","severity":"breaking","affected_versions":">=12.0"},{"fix":"Review Objective-C code that interacts with Python-defined `init` methods for potential memory management or reference counting implications.","message":"PyObjC 11.1 introduced changes to align the core bridge's behavior with `clang`'s Automatic Reference Counting (ARC) for Objective-C initializer (`init`) methods. Methods in the 'init' family now correctly steal a reference to `self` and return a new one, potentially affecting manual memory management or object lifecycle expectations.","severity":"breaking","affected_versions":">=11.1"},{"fix":"Consult Apple's official CoreAudio documentation and be prepared for complex interactions when working with this framework.","message":"CoreAudio is a very low-level framework, and its PyObjC bindings lack direct documentation or simple Python examples. Many C structures require explicit handling, and APIs for implementing CoreAudio plugins are not supported. Using it effectively requires deep knowledge of Apple's CoreAudio C API.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure you are using `pyobjc-core` version 10.3.1 or newer if your Python classes override `__new__` and also define `__init__`.","message":"PyObjC 10.3 temporarily broke the ability for Python classes to define `__init__` methods when they or their superclasses also implemented `__new__`. This issue was resolved in PyObjC 10.3.1.","severity":"gotcha","affected_versions":"10.3"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}