using kSequenceTrackProperty_AutomatedParameters and scheduling multichannelmixer parameters on iOS
using kSequenceTrackProperty_AutomatedParameters and scheduling multichannelmixer parameters on iOS
- Subject: using kSequenceTrackProperty_AutomatedParameters and scheduling multichannelmixer parameters on iOS
- From: Aran Mulholland <email@hidden>
- Date: Tue, 13 Dec 2011 09:08:31 +1100
I'm attempting to use parameter automation to fade the volume in on a
mulitchannelmixer on iOS. The following code is where I set up my
ParameterEvents and assign them to the track that is associated with
the mixer. when I run the following code I get the volume at 0 and 5
seconds later I get the volume back at full strength. So far so good,
I know the music track is hooked up to the mixer and can control the
parameters of it.
ParameterEvent startEvent;
startEvent.parameterID = kMultiChannelMixerParam_Volume;
startEvent.scope = kAudioUnitScope_Input;
startEvent.element = 0;
startEvent.value = 0.0;
ParameterEvent endEvent;
endEvent.parameterID = kMultiChannelMixerParam_Volume;
endEvent.scope = kAudioUnitScope_Input;
endEvent.element = 0;
endEvent.value = 1.0;
MusicTimeStamp musicTimeStamp = 0;
MusicPlayerGetTime(musicPlayer, &musicTimeStamp);
MusicTimeStamp startEventTimeStamp = musicTimeStamp + 0.1;
MusicTimeStamp endEventTimeStamp = musicTimeStamp + 5.0;
MusicTrackNewParameterEvent(mainMixerUnitOneAutomationTrack,
startEventTimeStamp, &startEvent);
MusicTrackNewParameterEvent(mainMixerUnitOneAutomationTrack,
endEventTimeStamp, &endEvent);
However what I would like is for the parameters to be ramped so before
the above code is called (in the setup of the music track) I add the
line:
UInt32 trackUsesAutomatedParameters = 1;
err = MusicTrackSetProperty (mainMixerUnitOneAutomationTrack,
kSequenceTrackProperty_AutomatedParameters,
&trackUsesAutomatedParameters, sizeof(UInt32));
This call returns 0, but when this is in effect the above scheduling
of parameters has no effect, the volume of the mixer stays at 1. Have
I misunderstood the kSequenceTrackProperty_AutomatedParameters
property or am I just using it incorrectly?
Thanks
Aran.
_______________________________________________
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