From ae00b6ebdee66d13453558f1c042a7e702a64443 Mon Sep 17 00:00:00 2001 From: phil Date: Thu, 7 Feb 2002 17:54:56 +0000 Subject: [PATCH] try lower latency, better print messages --- pa_tests/patest_latency.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pa_tests/patest_latency.c b/pa_tests/patest_latency.c index 2daf431..a081b29 100644 --- a/pa_tests/patest_latency.c +++ b/pa_tests/patest_latency.c @@ -3,7 +3,7 @@ * Hear the latency caused by bug buffers. * Play a sine wave and change frequency based on letter input. * - * Author: Phil Burk + * Author: Phil Burk , and Darren Gibbs * * This program uses the PortAudio Portable Audio Library. * For more information see: http://www.portaudio.com @@ -36,15 +36,18 @@ #include #include #include "portaudio.h" + #define OUTPUT_DEVICE (Pa_GetDefaultOutputDeviceID()) #define SAMPLE_RATE (44100) -#define FRAMES_PER_BUFFER (256) -#if 1 +#define FRAMES_PER_BUFFER (64) + +#if 0 #define MIN_LATENCY_MSEC (2000) #define NUM_BUFFERS ((MIN_LATENCY_MSEC * SAMPLE_RATE) / (FRAMES_PER_BUFFER * 1000)) #else #define NUM_BUFFERS (0) #endif + #define MIN_FREQ (100.0f) #define CalcPhaseIncrement(freq) ((freq)/SAMPLE_RATE) #ifndef M_PI @@ -108,7 +111,7 @@ int main(void) paTestData data; int i; int done = 0; - printf("PortAudio Test: output sine sweep. ask for %d buffers\n", NUM_BUFFERS ); + printf("PortAudio Test: enter letter then hit ENTER. numBuffers = %d\n", NUM_BUFFERS ); /* initialise sinusoidal wavetable */ for( i=0; i