Re: AudioUnitScheduleParameters: ramped kMultiChannelMixerParam_Volume
Re: AudioUnitScheduleParameters: ramped kMultiChannelMixerParam_Volume
- Subject: Re: AudioUnitScheduleParameters: ramped kMultiChannelMixerParam_Volume
- From: William Stewart <email@hidden>
- Date: Mon, 14 Jun 2010 12:46:13 -0700
you are misunderstanding how this works, it doesn't work like this.
There are some notes about how ScheduleParameters work in the headers, but basically it is about setting parameter values on a given buffer. It is not a generic "schedule ahead" feature.
For that, you would need MusicSequence (on desktop, see <AudioToolbox/MusicPlayer.h>
Also, you need to first check to see if a given parameter supports ramping (in the parameter info), otherwise the behaviour is undefined. The implementation won't return an error at the time the event is scheduled, as it doesn't know what the implementation class will do with the parameter event. This is a "driver take care" feature.
On Jun 11, 2010, at 2:16 PM, uɐıʇəqɐz pnoqɥɒɯ wrote:
> Bug Reporter ids: 8084919 & 8084938
>
> I was disappointed when the following code did nothing:
>
> AudioUnitParameterEvent inEvent;
> memset(&inEvent, 0, sizeof(inEvent));
>
> inEvent.scope = kAudioUnitScope_Input;
> inEvent.element = 2;
> inEvent.parameter = kMultiChannelMixerParam_Volume;
> inEvent.eventType = kParameterEvent_Ramped;
>
> // for this set of frames, what are the ramping values associated with the begin/end times?
> inEvent.eventValues.ramp.startValue = 1.0;
> inEvent.eventValues.ramp.endValue = 0;
> inEvent.eventValues.ramp.durationInFrames = 1000*1024;
> inEvent.eventValues.ramp.startBufferOffset = 2000*1024;
>
> result = AudioUnitScheduleParameters(userData->mMixer, &inEvent, 1);
> if(result != 0)
> printf("cant set up the scheduled param: %d\r\n", result);
> }
> I was trying to have scheduled and smooth fade of audio starting about two seconds in the future, where the fade would take about one second. The above code gave me no errors and did nothing to the volume. Replacing _Ramped with _Immediate, I got an immediate volume change from 1 to 0.
>
> If you too would like to see CoreAudio add ramped support for scheduled volume changes to input or output of the multiChannelMixer, then file a Bug Reporter request.
>
> If you too would like AudioUnitScheduleParameters to return an error when a type is not supported, i.e. _Ramped, then file a Bug Reporter bug. _______________________________________________
> 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
_______________________________________________
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