I've been using the Wav library in one of my apps for calibrating our mechanical timers - if the user is too slow it gives five low tones, too fast five high tones and within range, a continuous mid tone. Very useful.
Then fiddling a bit with the demo application, agraham's note about having the sampling 2.5 times the desired frequency is quite important. For example, if you keep the default rate of 11025samp.s-1; play a tone of 6kHz and 8kHz. The 8kHz tone sounds appreciably
lower than the 6kHz tone. A good example of
Quantization. That's probably why CD audio is sampled at 44.1kHz.
Using 44100 with the library produces the correct tone.