fix: framed_test parse every comma band (was first-arg only); comb tests were single-band
This commit is contained in:
+7
-6
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user