Greg's answer is right in the sense that kAudioUnitProperty_ParameterList is the right property ID to query to eventually get all parameters of a unit. However, the way to get all parameters is a bit more involved:
- Use
AudioUnitGetPropertyInfo
to see if the property is available and if it is, get back its data size (data size for the whole info which might be a collection, not for a single element of whatever type the property is, mind you). Use
AudioUnitGetProperty
proper to get the property back. Also, at this point, if the property you got back is a collection of elements as opposed to a single one, you'll have to callAudioUnitGetProperty
once for each element. Specifically, you'll call itdataSize / sizeof(TypeToHoldSingleInstanceOfYourProperty)
times.// Get number of parameters in this unit (size in bytes really): UInt32 parameterListSize = 0; AudioUnitGetPropertyInfo(_audioUnit, kAudioUnitProperty_ParameterList, kAudioUnitScope_Global, 0, ¶meterListSize, NULL); // Get ids for the parameters: AudioUnitParameterID *parameterIDs = malloc(parameterListSize); AudioUnitGetProperty(_audioUnit, kAudioUnitProperty_ParameterList, kAudioUnitScope_Global, 0, parameterIDs, ¶meterListSize); AudioUnitParameterInfo parameterInfo_t; UInt32 parameterInfoSize = sizeof(AudioUnitParameterInfo); UInt32 parametersCount = parameterListSize / sizeof(AudioUnitParameterID); for(UInt32 pIndex = 0; pIndex < parametersCount; pIndex++){ AudioUnitGetProperty(_audioUnit, kAudioUnitProperty_ParameterInfo, kAudioUnitScope_Global, parameterIDs[pIndex], ¶meterInfo_t, ¶meterInfoSize); // do whatever you want with each parameter... }