fix: framed_test parse every comma band (was first-arg only); comb tests were single-band

This commit is contained in:
2026-08-21 00:52:44 +03:00
parent b333f6828f
commit e990c21e94
2 changed files with 26 additions and 6 deletions
+7 -6
View File
@@ -65,12 +65,13 @@ int main(int argc, char** argv) {
if (!load_wav(argv[1], x, sr)) { fprintf(stderr, "cannot load %s\n", argv[1]); return 1; }
std::vector<DetectorBand> bands;
if (argc >= 4 && strchr(argv[3], ',')) {
// comma form: "fc,q,sens[,scale]"
float fc, q, sens, scl = 1.0f;
// parse first 3
int n = sscanf(argv[3], "%f,%f,%f,%f", &fc, &q, &sens, &scl);
DetectorBand b; b.fc = fc; b.q = q; b.sens = sens; b.level_scale = scl;
bands.push_back(b);
// comma form: one or more "fc,q,sens[,scale]" args, each parsed separately
for (int i = 3; i < argc; i++) {
float fc, q, sens, scl = 1.0f;
if (sscanf(argv[i], "%f,%f,%f,%f", &fc, &q, &sens, &scl) < 3) continue;
DetectorBand b; b.fc = fc; b.q = q; b.sens = sens; b.level_scale = scl;
bands.push_back(b);
}
} else {
for (int i = 3; i + 2 < argc; i += 3) {
DetectorBand b;