src/common/pa_trace.o \
src/hostapi/skeleton/pa_hostapi_skeleton.o
+LOOPBACK_OBJS = \
+ qa/loopback/src/audio_analyzer.o \
+ qa/loopback/src/biquad_filter.o \
+ qa/loopback/src/paqa_tools.o \
+ qa/loopback/src/test_audio_analyzer.o \
+ qa/loopback/src/write_wav.o \
+ qa/loopback/src/paqa.o
+
TESTS = \
bin/paqa_devs \
bin/paqa_errs \
SUBDIRS =
@ENABLE_CXX_TRUE@SUBDIRS += bindings/cpp
-all: lib/$(PALIB) all-recursive tests
+all: lib/$(PALIB) all-recursive tests loopback
tests: bin-stamp $(TESTS)
+loopback: bin-stamp bin/paloopback
# With ASIO enabled we must link libportaudio and all test programs with CXX
lib/$(PALIB): lib-stamp $(LTOBJS) $(MAKEFILE) $(PAINC)
@WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS)
@WITH_ASIO_TRUE@ $(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $(CXXFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS)
+bin/paloopback: lib/$(PALIB) $(MAKEFILE) $(PAINC) $(LOOPBACK_OBJS)
+ @WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(LOOPBACK_OBJS) lib/$(PALIB) $(LIBS)
+ @WITH_ASIO_TRUE@ $(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $(CXXFLAGS) $(LOOPBACK_OBJS) lib/$(PALIB) $(LIBS)
install: lib/$(PALIB) portaudio-2.0.pc
$(INSTALL) -d $(DESTDIR)$(libdir)
$(MAKE) uninstall-recursive
clean:
- $(LIBTOOL) --mode=clean rm -f $(LTOBJS) $(ALL_TESTS) lib/$(PALIB)
+ $(LIBTOOL) --mode=clean rm -f $(LTOBJS) $(LOOPBACK_OBJS) $(ALL_TESTS) lib/$(PALIB)
$(RM) bin-stamp lib-stamp
-$(RM) -r bin lib
}
recording->numFrames += framesToWrite;
return (recording->numFrames >= recording->maxFrames);
-
-error:
- return -1;
}
/*==========================================================================================*/
}
recording->numFrames += framesToRecord;
return (recording->numFrames >= recording->maxFrames);
-
-error:
- return -1;
}
/*==========================================================================================*/
}
recording->numFrames += framesToRecord;
return (recording->numFrames >= recording->maxFrames);
-
-error:
- return -1;
}
/*==========================================================================================*/
double phase = 666.0;
double mag = PaQa_CorrelateSine( recording, testTone->frequency, testTone->sampleRate, i, windowSize, &phase );
- if( loopCount > 1)
+ if( (loopCount > 1) && (mag > 0.0) )
{
double phaseDelta = PaQa_ComputePhaseDifference( phase, previousPhase );
double phaseError = PaQa_ComputePhaseDifference( phaseDelta, expectedPhaseIncrement );
if( (analysisResult->latency >= 0) && (analysisResult->amplitudeRatio > 0.1) )
{
- analysisResult->valid = 1;
+ analysisResult->valid = (1);
result = PaQa_DetectPop( recording, testTone, analysisResult );
QA_ASSERT_EQUALS( "detect pop", 0, result );
return 0;
error:
return -1;
-}
+}
+
\r
\r
#define QA_ASSERT_EQUALS( message, expected, actual ) \\r
- if( (expected) != (actual) ) \\r
+ if( ((expected) != (actual)) ) \\r
{ \\r
printf( "%s:%d - ERROR - %s, expected %d, got %d\n", __FILE__, __LINE__, message, expected, actual ); \\r
g_testsFailed++; \\r
#define FRAMES_PER_BLOCK (64)
#define PRINT_REPORTS 0
+#define TEST_SAVED_WAVE (0)
+
/*==========================================================================================*/
/**
* Detect a single tone.
return 0;
}
-
+#if TEST_SAVED_WAVE
/*==========================================================================================*/
/**
* Simple test that write a sawtooth waveform to a file.
printf("ERROR: result = %d\n", result );
return result;
}
+#endif /* TEST_SAVED_WAVE */
/*==========================================================================================*/
/**
int PaQa_TestAnalyzer( void )
{
int result;
-
+#if TEST_SAVED_WAVE
// Write a simple wave file.
- //if (result = TestSavedWave()) return result;
+ if ((result = TestSavedWave()) != 0) return result;
+#endif /* TEST_SAVED_WAVE */
// Generate single tone and verify presence.
- if (result = TestSingleMonoTone()) return result;
+ if ((result = TestSingleMonoTone()) != 0) return result;
// Generate prime series of tones and verify presence.
- if (result = TestMixedMonoTones()) return result;
+ if ((result = TestMixedMonoTones()) != 0) return result;
// Detect dropped or added samples in a sine wave recording.
- if (result = TestDetectPhaseErrors()) return result;
+ if ((result = TestDetectPhaseErrors()) != 0) return result;
// Test to see if notch filter can knock out the test tone.
- if (result = TestNotchFilter()) return result;
+ if ((result = TestNotchFilter()) != 0) return result;
// Detect pops that get back in phase.
- if (result = TestDetectPops()) return result;
+ if ((result = TestDetectPops()) != 0) return result;
-
return 0;
}