pps=44100/2048.
calc_delay = lambda x,y: max(ceil(4096/((x/pps)/8.)),y)/pps
colors=["red","orange","yellow","green","blue","purple","grey","black",[0.0,0.5,0.5]]
plots=[plot(lambda x: calc_delay(x,y)-calc_delay(x,0),32e3,720e3,rgbcolor=colors[y-2]) for y in range(2,11)]
print "Additional latency as a function of bitrate for several thresholds"
show(sum(plots))