PaQa_EraseBuffer( buffer, cycleSize, testTone->samplesPerFrame );
PaQa_MixSine( &generator, buffer, cycleSize, testTone->samplesPerFrame );
- threshold = cycleSize * 0.01;
+ threshold = cycleSize * 0.02;
analysisResult->latency = PaQa_FindFirstMatch( recording, buffer, cycleSize, threshold );
QA_ASSERT_TRUE( "Could not find the start of the signal.", (analysisResult->latency >= 0) );
analysisResult->amplitudeRatio = PaQa_CompareAmplitudes( recording, analysisResult->latency, buffer, cycleSize );
return loopbackContext->done ? paComplete : paContinue;
}
-static void CopyStreamInfoToLoopbackContext( LoopbackContext *loopbackContext, const PaStream *inputStream, const PaStream *outputStream )
+static void CopyStreamInfoToLoopbackContext( LoopbackContext *loopbackContext, PaStream *inputStream, PaStream *outputStream )
{
- PaStreamInfo *inputStreamInfo = Pa_GetStreamInfo( inputStream );
- PaStreamInfo *outputStreamInfo = Pa_GetStreamInfo( outputStream );
+ const PaStreamInfo *inputStreamInfo = Pa_GetStreamInfo( inputStream );
+ const PaStreamInfo *outputStreamInfo = Pa_GetStreamInfo( outputStream );
loopbackContext->streamInfoInputLatency = inputStreamInfo ? inputStreamInfo->inputLatency : -1;
loopbackContext->streamInfoOutputLatency = outputStreamInfo ? outputStreamInfo->outputLatency : -1;
testParamsPtr->inputParameters.device = inputDevice;
testParamsPtr->inputParameters.sampleFormat = paFloat32;
testParamsPtr->inputParameters.channelCount = testParamsPtr->samplesPerFrame;
- testParamsPtr->inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputDevice )->defaultHighInputLatency;
+ testParamsPtr->inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputDevice )->defaultLowInputLatency;
+ //testParamsPtr->inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputDevice )->defaultHighInputLatency;
testParamsPtr->outputParameters.device = outputDevice;
testParamsPtr->outputParameters.sampleFormat = paFloat32;
testParamsPtr->outputParameters.channelCount = testParamsPtr->samplesPerFrame;
- testParamsPtr->outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputDevice )->defaultHighOutputLatency;
+ testParamsPtr->outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputDevice )->defaultLowOutputLatency;
+ //testParamsPtr->outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputDevice )->defaultHighOutputLatency;
}
/*******************************************************************/
{
int result;
+//( double sampleRate, int stepPosition, int cycleSize, int latencyFrames, double stepAmplitude )
// No spike.
result = TestSingleInitialSpike( 44100, 32, 100, 537, 0.0 );
if( result < 0 ) return result;
#if TEST_SAVED_WAVE
/*==========================================================================================*/
/**
- * Simple test that write a sawtooth waveform to a file.
+ * Simple test that writes a sawtooth waveform to a file.
*/
static int TestSavedWave()
{