36 soxr_datatype_t type =
46 soxr_io_spec_t io_spec = soxr_io_spec(type, type);
48 soxr_quality_spec_t q_spec = soxr_quality_spec((
int)((precision-2)/4), (SOXR_HI_PREC_CLOCK|SOXR_ROLLOFF_NONE)*!!cheby);
49 q_spec.precision = linear? 0 : precision;
50 q_spec.bw_pc = cutoff?
FFMAX(
FFMIN(cutoff,.995),.8)*100 : q_spec.bw_pc;
52 soxr_delete((soxr_t)c);
54 soxr_create(in_rate, out_rate, 0, &error, &io_spec, &q_spec, 0);
61 soxr_delete((soxr_t)*c);
72 AudioData *src,
int src_size,
int *consumed){
74 soxr_error_t error = soxr_set_error((soxr_t)c, soxr_set_num_channels((soxr_t)c, src->
ch_count));
75 error = soxr_process((soxr_t)c, src->
ch, (
size_t)src_size,
76 &idone, dst->
ch, (
size_t)dst_size, &odone);
77 *consumed = (int)idone;
78 return error? -1 : odone;
83 return (int64_t)(delay_s * base + .5);