Check out the last item of the second (zipped) sample that comes with MediaLab--it shows you how to do exactly that.