From ac176b94629e8f20e9639118b81a196d9752bf6e Mon Sep 17 00:00:00 2001 From: rossb Date: Thu, 28 Jul 2011 05:26:15 +0000 Subject: [PATCH] paqa_latency: print device name and api. c89ize --- qa/paqa_latency.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qa/paqa_latency.c b/qa/paqa_latency.c index 4d526e7..6cbd997 100644 --- a/qa/paqa_latency.c +++ b/qa/paqa_latency.c @@ -111,6 +111,8 @@ PaError paqaCheckLatency( PaStreamParameters *outputParamsPtr, { PaError err; PaStream *stream; + const PaStreamInfo* streamInfo; + dataPtr->minFramesPerBuffer = 9999999; dataPtr->maxFramesPerBuffer = 0; printf("-------------------------------------\n"); @@ -132,7 +134,7 @@ PaError paqaCheckLatency( PaStreamParameters *outputParamsPtr, printf("Play for %d seconds.\n", NUM_SECONDS ); Pa_Sleep( NUM_SECONDS * 1000 ); - const PaStreamInfo* streamInfo = Pa_GetStreamInfo( stream ); + streamInfo = Pa_GetStreamInfo( stream ); printf("Stream inputLatency = %g\n", streamInfo->inputLatency ); printf("Stream outputLatency = %g\n", streamInfo->outputLatency ); printf(" minFramesPerBuffer = %4d\n", dataPtr->minFramesPerBuffer ); @@ -184,9 +186,11 @@ int main(void) fprintf(stderr,"Error: No default output device.\n"); goto error; } + outputParameters.channelCount = 2; /* stereo output */ outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */ deviceInfo = Pa_GetDeviceInfo( outputParameters.device ); + printf("using device #%d: '%s' (%s)\n", outputParameters.device, deviceInfo->name, Pa_GetHostApiInfo(deviceInfo->hostApi)->name); printf("defaultLowOutputLatency = %f seconds\n", deviceInfo->defaultLowOutputLatency); printf("defaultHighOutputLatency = %f seconds\n", deviceInfo->defaultHighOutputLatency); outputParameters.hostApiSpecificStreamInfo = NULL; -- 2.43.0