Both nice suggestions.
Frequency comes from how the angle is generated. Knowing the samples are generated at 11025Hz for example, you need to create an angle that steps through one period (or 2*pi) in the right amount of time. Unfortunately, the data array length only fits certain exact multiples of frequencies. For example, with a length of 441 samples, the data plays out in exactly 40ms. If that is one period then you get 25Hz. Put two periods in the 441 samples you get 50Hz etc. I happen to be generating pretty low frequencies, so the slower 11025 sample rate makes sense. Remember the byte size data array has to be twice as big as the samples for mono and 4 times if you have stereo. If you want to infinite precision in the frequency, the process gets complicated.