Looping through a QE Sequence to add audio transitions
I'm attempting to loop through a sequence and apply two frame audio fades at the head and tail of each audio track. Each audio track only has a single item on it.
My issue is that the loop stops after only two tracks, despite there being audio on the third track. Here's the code:
app.enableQE();
var transitionToApply = qe.project.getAudioTransitionByName("Constant Power");
var activeSeq = qe.project.getActiveSequence();
for(var i=0; i < activeSeq.getAudioTrackAt(i).numItems; i++){
var clips = activeSeq.getAudioTrackAt(i).getItemAt(0);
clips.addTransition(transitionToApply, false, "00;00;00;02");
clips.addTransition(transitionToApply, true, "00;00;00;02");
}
I've verified that alert(activeSeq.getAudioTrackAt(2).getItemAt(0).name); gives me the name of the first item on the third audio track and that I can apply fades manually, but I'm unable to accomplish this with a loop. Any insight would be appreciated!
