Well, first you have to generate two sine waves of a particular frequency. Basically, you get to know the current samplerate of your soundcard and just generate a series of floats that represent a sine wave of a certain frequency at that samplerate. I.e. for a soundcard with 48000 Hz and a frequency of 1000 Hz, each full sine wave (one hill, one trough) should consist of 48 samples.
Note that the maximum frequency you can generate is half the samplerate.
Next, you generate the second sine wave with the second frequency. Make sure that the two frequencies have a certain distance from one another. A frequency factor of one semitone should suffice for that factor >= (1+1/12)
.
Also make sure that the sum of both sinuses does not overshoot the max amplitude. The easiest way to do this is by limiting both sinuses to amplitudes <= 0.5
. Overshooting will clip the signal, which will create new frequency peaks.
On the receiving end, do a FFT of short time slices (around 256-1024 samples) of the incoming signal. For better frequency resolution, take overlapping slices and gradually fade out the ends, then time-average the spectral slices. In the resulting spectrum you should clearly see peaks at the two sent frequencies.
If you don't know much about audio, this is probably a pretty tough task.