PyObjC MediaToolbox Framework

12.1 · active · verified Tue Apr 14

PyObjC provides Python bindings for Objective-C frameworks on macOS, enabling Python developers to interact with Apple's system APIs. `pyobjc-framework-mediatoolbox` offers wrappers for the MediaToolbox framework, which supports media format readers and audio processing. The library is currently at version 12.1 and maintains an active release cadence, typically aligning with macOS and Python version updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates successful installation and basic import of the `MediaToolbox` framework, confirming the PyObjC bridge is active. Real-world usage would involve interacting with specific classes and functions provided by Apple's MediaToolbox framework.

import MediaToolbox
import Foundation

# Simply importing the framework demonstrates it's loadable.
# Accessing a generic Objective-C class (e.g., NSObject from Foundation)
# via any PyObjC framework binding confirms the bridge is working.

# In a real application, you would access MediaToolbox-specific classes or functions
# e.g., MediaToolbox.MTAudioProcessingTapCreate
# or constants like kCMFormatDescriptionBridgeError_InvalidParameter if exposed via MediaToolbox or an imported dependency.

print(f"MediaToolbox module loaded from: {MediaToolbox.__file__}")

# Verify that basic PyObjC functionality is available by accessing NSObject
# which is part of Foundation, implicitly loaded or linked by most PyObjC frameworks.
if hasattr(Foundation, 'NSObject'):
    print(f"Foundation.NSObject available, indicating PyObjC bridge is active.")
else:
    print("Foundation.NSObject not found, PyObjC bridge might not be fully active.")

view raw JSON →