Audio frequency modulation algorithm
You need to build a time varying delay, where you can modulate the delay amount over time. 

The peak delay modulation is a function of your maximum desired frequency shift and the modulation frequency. 

This is not trivial since it will require fractional sample delays with some kind of interpolation algorithm. You can't round to the nearest integer delay without "zipper" noise. The best interpolation method depends on the specific requirements of your application (tolerance for noise, input spectrum, MIPS &amp; memory available, etc.)