Skip to content

Commit

Permalink
fixed issue about makeFrequencyWithCP, but it has some glitch sound
Browse files Browse the repository at this point in the history
  • Loading branch information
designe committed Jan 25, 2020
1 parent 4d6da84 commit 86198db
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -68,9 +68,12 @@ public short[] makeFrequencyWithCP(int freq) {
int bufferIdx = 0;
double theta = 0;
int i = mCpIndex;
for(; i < mCpIndex + mBufferSize; i++) {
int bufferSize = mCpIndex + mBufferSize;
for(; i < bufferSize; i++) {
theta = x * i / mSampleRate - thetaDiff;
source[bufferIdx++] = (short)Math.sin(theta);
double_source[bufferIdx] = Math.sin(theta);
source[bufferIdx] = (short)(32767 * double_source[bufferIdx]);
bufferIdx++;
}

mCpIndex = i;
Expand Down

0 comments on commit 86198db

Please sign in to comment.