Closed AndrewBelt closed 8 years ago
This software has promising performance, but I cannot produce anything but a vector of zeros as its output. Here is my attempt at using the library. Do you see anything wrong?
unsigned dither = 0xc90fdaa2; struct lfr_param *param = lfr_param_new(); assert(param); lfr_param_seti(param, LFR_PARAM_QUALITY, LFR_QUALITY_MEDIUM); int inrate = 32*44100; int outrate = 44100; lfr_param_seti(param, LFR_PARAM_INRATE, inrate); lfr_param_seti(param, LFR_PARAM_OUTRATE, outrate); lfr_fixed_t inv_ratio = 32ll << 32; struct lfr_filter *filter; lfr_filter_new(&filter, param); assert(filter); lfr_fixed_t pos = -lfr_filter_delay(filter); float input[inrate]; float output[outrate]; for (int i = 0; i < inrate; i++) { input[i] = 2.0*((float)rand() / RAND_MAX) - 1.0; } lfr_resample(&pos, inv_ratio, &dither, 1, output, LFR_FMT_F32_NATIVE, inrate, input, LFR_FMT_F32_NATIVE, outrate, filter); for (int i = 0; i < outrate; i++) { printf("%f\n", output[i]); }
pos is not being advanced, making me think that lfr_resample is returning early due to an error.
pos
lfr_resample
Fixed! Seems like only LFR_FMT_S16_NATIVE to LFR_FMT_S16_NATIVE formats are supported.
LFR_FMT_S16_NATIVE
Thanks for your interest! This project could use some love and I'm planning on revisiting it soon.
This software has promising performance, but I cannot produce anything but a vector of zeros as its output. Here is my attempt at using the library. Do you see anything wrong?
pos
is not being advanced, making me think thatlfr_resample
is returning early due to an error.