AudioUnitScheduleParameters with kStereoMixerParam_Volume
AudioUnitScheduleParameters with kStereoMixerParam_Volume
- Subject: AudioUnitScheduleParameters with kStereoMixerParam_Volume
- From: Benjamin Federer <email@hidden>
- Date: Thu, 21 Jul 2016 19:18:18 +0200
Hello everyone
I am trying to ramp the input volume for one of the input busses of a stereo mixer unit (part of an AUGraph). Although I don’t get any errors when running my code, nothing happens at all, i.e. no audible volume changes occur. I am unsure what I am missing. Or could it be that the parameter just cannot be ramped at all – although it reports otherwise?
This is what I got so far:
AudioUnitParameter parameter = {
.mAudioUnit = mixerUnit,
.mParameterID = kStereoMixerParam_Volume,
.mScope = kAudioUnitScope_Input,
.mElement = busNumber
};
AudioUnitParameterInfo parameterInfo = {};
UInt32 parameterInfoSize = sizeof(AudioUnitParameterInfo);
error = AudioUnitGetProperty(parameter.mAudioUnit, kAudioUnitProperty_ParameterInfo, parameter.mScope, parameter.mParameterID, ¶meterInfo, ¶meterInfoSize);
if (error)
{
return error;
}
AudioUnitParameterOptions parameterOptions = parameterInfo.flags;
if ((parameterOptions & kAudioUnitParameterFlag_CanRamp) != kAudioUnitParameterFlag_CanRamp)
{
// parameter cannot be ramped-
return paramErr;
}
AudioUnitParameterEvent parameterEvent = {
.scope = parameter.mScope,
.element = parameter.mElement,
.parameter = parameter.mParameterID,
.eventType = kParameterEvent_Ramped,
.eventValues.ramp.startBufferOffset = 0,
.eventValues.ramp.durationInFrames = durationInFrames,
.eventValues.ramp.startValue = startValue,
.eventValues.ramp.endValue = endValue
};
error = AudioUnitScheduleParameters(parameter.mAudioUnit, ¶meterEvent, 1);
Thanks for any help in advance
Benjamin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden