-
Time remap Audio with Expressions, Crashes on Render/Ram Preview
I have a .wav file that I am trying to time remap so that each second it will jump to another point in time and play, then jump to another point in time, and continue doing this. I have used this expression without any problem on video clips, but for some reason when I use it on audio it doesn’t work. If I try to ram preview AE just freezes up. When I try to render it (to either a new wav file or to a mov file) I get an error popup that reads “could not allocate sound memory”.
I thought it might have something to do with the expression, since I can do a simple time remap on the audio and it renders without issue.
Any help would be great!
The Expression:
n = 1440; // divide clip into 1440 segments
segDur = (outPoint - inPoint)/n;
segs = [];
for (i = 0; i < n; i++) segs[i] = i;
seedRandom(index,true);
for (i = 0; i < n; i++){
idx = i + Math.floor(random(segs.length - i));
temp = segs[i];
segs[i] = segs[idx];
segs[idx] = temp;
}
curSeg = Math.max(Math.min(Math.floor((time - inPoint)/segDur),n-1),0);
t = (time - inPoint)%segDur;
segs[curSeg]*segDur + t