feat: select audible sample boundaries with threshold and padding controls

This commit is contained in:
Johannes Findeisen 2026-11-06 01:08:01 +01:00
commit 392e437d32
8 changed files with 32 additions and 5 deletions

View file

@ -55,5 +55,9 @@ int main(void)
assert(xtc_sample_process(s,4,6,XTC_SAMPLE_NORMALIZE,1,&q)==XTC_ERR_INVALID_STATE && q==NULL);
assert(xtc_sample_process(s,1,7,XTC_SAMPLE_GAIN,NAN,&q)==XTC_ERR_INVALID_ARGUMENT && q==NULL);
assert(xtc_sample_process(s,1,7,XTC_SAMPLE_GAIN,17,&q)==XTC_ERR_INVALID_ARGUMENT && q==NULL);}
{size_t b=999,e=999;assert(xtc_sample_audible_bounds(s,0,8,.25,0,&b,&e)==XTC_OK && b==2 && e==7);
assert(xtc_sample_audible_bounds(s,0,8,.25,2,&b,&e)==XTC_OK && b==0 && e==8);
b=e=999;assert(xtc_sample_audible_bounds(s,4,6,0,0,&b,&e)==XTC_ERR_NOT_FOUND && b==999 && e==999);
assert(xtc_sample_audible_bounds(s,0,8,NAN,0,&b,&e)==XTC_ERR_INVALID_ARGUMENT && b==999);}
xtc_sample_destroy(s);assert(unlink(path)==0 && rmdir(root)==0);puts("Sample editor core tests passed.");return 0;
}