I think I could find the problem  :)
As we know it, increasing a wave's frequency means decreasing in wavelength.  As lambda=1/frequency, when reaching 2kHz the wave's period shortens to the size of only 4 samples, which I think can not be considered as a sine wave anymore, but more like a triangular wave or so... This phenomenon occured, because of the small size of the sampling rate. You chose 8000 samples for sample rate.
I've been looking for the sun.audio & sun.audio.AudioPlayer APIs but could not find my way to change it to 44kHz.
May I ask you, why you chose 8000 samples? How did you know, that this should be the exact sample rate? Or what documentation have you followed when creating your code?  :)