Using objc_util call objc function,need define a struct.
OSType is c_char_P ??
from objc_util import *
import ctypes
AVAudioUnit=ObjCClass('AVAudioUnit')
AVAudioUnitComponent=ObjCClass('AVAudioUnitComponent')
AVAudioUnitComponentManager=ObjCClass('AVAudioUnitComponentManager')
#
# componentType,componentSubType,componentManufacturer is OSType
#
# ref: developer.apple.com/reference/audiotoolbox/audiocomponentdescription
#
class AudioComponentDescription(ctypes.Structure):
_fields_=[('componentType',ctypes.c_char_p),('componentSubType',ctypes.c_char_p),('componentManufacturer',ctypes.c_char_p),('componentFlags',ctypes.c_uint32),('componentFlagsMask',ctypes.c_uint32)]
anyEffect = AudioComponentDescription('aufx','dcmp','appl',0,0)
availableEffects = AVAudioUnitComponentManager.sharedAudioUnitComponentManager().componentsMatchingDescription_(anyEffect)
Error Message:
File "/var/containers/Bundle/Application/1E0EEE41-E357-4C4B-9564-45BDC5519D55/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib/site-packages/objc_util.py", line 897, in call
res = objc_msgSend(obj.ptr, sel(self.sel_name), *args)
ArgumentError: argument 3: