feat: snap sample selection boundaries to deterministic nearby zero crossings

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

View file

@ -26,6 +26,10 @@ xtc_result xtc_sample_process(const xtc_sample *sample,size_t begin,size_t end,
* to the input range. All-silent returns NOT_FOUND; outputs unchanged on error. */
xtc_result xtc_sample_audible_bounds(const xtc_sample *sample,size_t begin,size_t end,
double threshold,size_t padding,size_t *first,size_t *last);
/* Nearest zero sample/sign crossing at a frame boundary; ties choose earlier.
* center 0..frames, radius <=65536 frames. Edge boundaries qualify only when
* the adjacent sample is zero. NOT_FOUND preserves output. */
xtc_result xtc_sample_zero_crossing(const xtc_sample *sample,size_t center,size_t radius,size_t *out);
/* Control-thread bounded mono float32 WAV save. Absolute path <512 bytes,
* NEW destination only. Failure/cancel publishes nothing and removes temporary. */
xtc_result xtc_sample_write(const xtc_sample *sample,size_t begin,size_t end,const char *path);