Fade audio with expressions
Ok, I've taken an epxression for automactically fading opacity (which worked wonderfully) and tried to modify it to fade audio the same way. Now, I get an error that says "After Effects warning: Expression Disabled. Error at line 0 in property.... expression result must be of dimension 2 not 1."
Here is the tweaked expression:
fadeTime = 30;
audio.audioLevelsMin = -50;
audio.audioLevelsMax = 0;
layerDuration = outPoint - inPoint;
singleFrame = thisComp.frameDuration;
animateIn = linear(time, inPoint, (inPoint + framesToTime(fadeTime)), audio.audioLevelsMin, audio.audioLevelsMax);
animateOut = linear(time, (outPoint - framesToTime(fadeTime+1)), (outPoint-singleFrame), audio.audioLevelsMax, audio.audioLevelsMin);
if(time < (layerDuration/2+inPoint)){
animateIn;
}else{
animateOut;
}
Now, opacity is a linear, 1 dimensional characteristic. Why did that work and the updated expression for audio cause an error?
