Sound tracking for video playback

Hi guys I tried making an audio visualizer with the standard fft example that comes with OF except I’m using the sound tracking to control playback of a video. Whenever the frequency exceed some threshold it would speed up the video for maybe a second or two and then slow down to regular until the next trigger. It is extremely laggy when it tries to speed up or slow down on my macbook air since it happens quite frequenctly, maybe 1 or 2 seconds apart if you know what I mean. Anyone know why or if it makes sense, would kicking off a separate thread for the video help at all. Thanks a lot.