How do I generate a Sine Sweep in Java (Android)
I found Playing an arbitrary tone with Android to be helpful when I was generating a frequency tone. Now I want the frequency to change while the tone is playing. I modified the genTone to be similar to this: private void genTone(double startFreq, double endFreq, int dur) { int numSamples = dur * sampleRate; sample = new double[numSamples]; double currentFreq = 0, numerator; for (int i = 0; i < numSamples; ++i) { numerator = (double) i / (double) numSamples; currentFreq = startFreq + (numerator * (endFreq - startFreq)); if ((i % 1000) == 0) { Log.e("Current Freq:", String.format("Freq is: %f