There is no iOS API for this audio synthesis.
But you can use the Audio Queue or Audio Unit RemoteIO API to play the original sound samples, generate an array of samples from 2 sine waves summarized (say, 44100 samples in 1 second), and then copy the results in the sound callback (1024 samples or any queries callback at the same time).
See Apple aurioTouch and SpeakHere sample applications for using these audio APIs.
Samples can be generated with something simple:
sample[i] = (short int)(v1*sinf(2.0*pi*i*f1/sr) + v2*sinf(2.0*pi*i*f2/sr));
where sr is the sampling frequency, f1 and f1 are 2 frequencies, and v1 + v2 is the sum less than 32767.0. You can add rounding or noise smoothing to get cleaner results.
Beware of clicking if the shapes you create do not shrink to zero at the ends.
hotpaw2
source share