diff --git a/Source/Audio.cpp b/Source/Audio.cpp index 374a2d4cb8..af26258f0f 100644 --- a/Source/Audio.cpp +++ b/Source/Audio.cpp @@ -28,7 +28,7 @@ const float AMPLITUDE_RATIO_AT_90 = 0.5; const short RING_BUFFER_FRAMES = 10; const short RING_BUFFER_SIZE_SAMPLES = RING_BUFFER_FRAMES * BUFFER_LENGTH_SAMPLES; -const short JITTER_BUFFER_LENGTH_MSECS = 50; +const short JITTER_BUFFER_LENGTH_MSECS = 40; const int SAMPLE_RATE = 22050; const short NUM_AUDIO_SOURCES = 2; @@ -422,7 +422,7 @@ void Audio::render(int screenWidth, int screenHeight) float remainingBuffer = 0; timeval currentTime; gettimeofday(¤tTime, NULL); - float timeLeftInCurrentBuffer = diffclock(currentTime, data->lastCallback)/(1000.0*(float)BUFFER_LENGTH_SAMPLES/(float)SAMPLE_RATE) * frameWidth; + float timeLeftInCurrentBuffer = diffclock(data->lastCallback, currentTime)/(1000.0*(float)BUFFER_LENGTH_SAMPLES/(float)SAMPLE_RATE) * frameWidth; //float timeLeftInCurrentBuffer = diffclock(currentTime, data->lastCallback)/23.22 * frameWidth; remainingBuffer = data->ringBuffer->diffLastWriteNextOutput() / BUFFER_LENGTH_SAMPLES * frameWidth; diff --git a/Source/main.cpp b/Source/main.cpp index 60203ffd13..1ef7e2ac7b 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -842,7 +842,7 @@ void mouseFunc( int button, int state, int x, int y ) mouse_x = x; mouse_y = y; mouse_pressed = 1; - lattice.mouseClick((float)x/(float)WIDTH,(float)y/(float)HEIGHT); +// lattice.mouseClick((float)x/(float)WIDTH,(float)y/(float)HEIGHT); } if( button == GLUT_LEFT_BUTTON && state == GLUT_UP ) {