fix: increase listen duration and add RMS logging in WAV load test
Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
@@ -944,15 +944,17 @@ static int test_wav_load(void) {
|
||||
unlink("loop.wav");
|
||||
return 1;
|
||||
}
|
||||
safe_usleep(4000000);
|
||||
safe_usleep(6000000); /* 6 seconds to ensure loop is heard */
|
||||
jack_deactivate(client);
|
||||
jack_client_close(client);
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
unlink("loop.wav");
|
||||
int got_bursts = bursts;
|
||||
printf(" detected bursts: %d\n", got_bursts);
|
||||
double rms = passthrough_total_samples > 0 ?
|
||||
sqrt(passthrough_sum_sq / passthrough_total_samples) : 0.0;
|
||||
printf(" detected bursts: %d, RMS: %.6f\n", got_bursts, rms);
|
||||
if (got_bursts < 3) {
|
||||
fprintf(stderr, " FAIL: expected ≥3 bursts from loaded loop, got %d\n", got_bursts);
|
||||
fprintf(stderr, " FAIL: expected ≥3 bursts from loaded loop, got %d, RMS=%.6f\n", got_bursts, rms);
|
||||
return 1;
|
||||
}
|
||||
printf(" PASS (loaded loop plays)\n");
|
||||
|
||||
Reference in New Issue
Block a user