-
Audio Expression
Hey all,
I’ve got two audio layers, one is a background track and the other is a voice over track. The voice over track is not always used, so I’m trying to figure out an expression where if the voice over is used, the audio track would fade down to say -18db from 0db and then fade back up to 0db once the voice over track is over.
I’m trying to work out a variation of this expression that Dan wrote on an Adobe forum:
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,animateIn];
}else{
[animateOut,animateOut];
}
Changing the above to this:
fadeTime = 20;
audio.audioLevelsMin = -18;
audio.audioLevelsMax = 0;
if(comp(“Slide 1 Image or Video”).layer(“Slide 1 Video Left”).audio.audioLevels) [-12]
[audio.audioLevelsMin,audio.audioLevelsMin];
}else{
[audio.audioLevelsMax,audio.audioLevelsMax];
}
The voice over track (comp(“Slide 1 Image or Video”).layer(“Slide 1 Video Left”) is set at -12 if there is a voice over track and -50 if there isn’t one, so I’m trying to write the expression to explain that if the voice over track is at -12 (meaning there is one), then the background music fades down from 0db to -18db.
I hope I’ve explained myself well.. if not please let me know.
Thanks!