PyObjC CoreAudio Framework

12.1 · active · verified Mon Apr 13

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.

Warnings

Install

Imports

Quickstart

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.

# The CoreAudio framework is very low-level and lacks simple Python examples.
# Refer to Apple's CoreAudio documentation for usage, as its API is complex.
# import CoreAudio
# e.g., to get a list of audio devices (this is conceptual and untested):
# try:
#     from CoreAudio import AudioObjectGetPropertyData, AudioObjectPropertyAddress
#     from CoreAudio import kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster
#     from CoreAudio import AudioHardwareGetPropertyInfo, AudioHardwareGetProperty
#     # ... (complex setup involving structs, callbacks, etc. not suitable for quickstart)
#     print("CoreAudio imported, but direct usage is complex.")
# except ImportError:
#     print("Could not import CoreAudio. Ensure pyobjc-framework-coreaudio is installed on macOS.")

view raw JSON →