Assuming you put the checkboxes on the Scene precomp layers, this is how I’d do it:
audioOn = -22;
audioOff = -6;
fadeFrames = 10;
fadeTime = framesToTime(fadeFrames);
v = audioOff;
for (i = 1; i <= thisComp.numLayers; i++){
myLayer = thisComp.layer(i);
if (myLayer.index == index) continue;
if (myLayer.name.indexOf("Scene") == 0 && time >= myLayer.inPoint && time <= myLayer.outPoint){
if (myLayer.effect("On")("Checkbox") == 1){
if (time < (myLayer.inPoint + myLayer.outPoint)/2){
v = linear(time,myLayer.inPoint,myLayer.inPoint + fadeTime,audioOff,audioOn);
}else{
v = linear(time,myLayer.outPoint - fadeTime,myLayer.outPoint,audioOn,audioOff);
}
}
break;
}
}
[v,v]