35 soxr_quality_spec_t q_spec;
36 if (dMinFactor == dMaxFactor)
39 q_spec = soxr_quality_spec(
"\0\1\4\6"[
mMethod], 0);
44 q_spec = soxr_quality_spec(SOXR_HQ, SOXR_VR);
46 mHandle.reset(soxr_create(1, dMinFactor, 1, 0, 0, &q_spec, 0));
54static const std::initializer_list<EnumValueSymbol>
methodNames{
55 {
wxT(
"LowQuality"),
XO(
"Low Quality (Fastest)") },
56 {
wxT(
"MediumQuality"),
XO(
"Medium Quality") },
57 {
wxT(
"HighQuality"),
XO(
"High Quality") },
58 {
wxT(
"BestQuality"),
XO(
"Best Quality (Slowest)") }
66 wxT(
"/Quality/LibsoxrSampleRateConverterChoice"),
72 wxT(
"/Quality/LibsoxrSampleRateConverter")
77 wxT(
"/Quality/LibsoxrHQSampleRateConverterChoice"),
83 wxT(
"/Quality/LibsoxrHQSampleRateConverter")
87std::pair<size_t, size_t>
89 const float *inBuffer,
99 inBuffer , (lastFlag? ~inBufferLen : inBufferLen), &idone,
100 outBuffer, outBufferLen, &odone);
104 soxr_set_io_ratio(
mHandle.get(), 1/factor, 0);
106 inBufferLen = lastFlag? ~inBufferLen : inBufferLen;
108 inBuffer , inBufferLen , &idone,
109 outBuffer, outBufferLen, &odone);
111 return { idone, odone };
static const std::initializer_list< EnumValueSymbol > methodNames
static auto intChoicesMethod
Resample(const bool useBestMethod, const double dMinFactor, const double dMaxFactor)
bool mbWantConstRateResampling
static EnumSetting< int > FastMethodSetting
void SetMethod(const bool useBestMethod)
std::pair< size_t, size_t > Process(double factor, const float *inBuffer, size_t inBufferLen, bool lastFlag, float *outBuffer, size_t outBufferLen)
Main processing function. Resamples from the input buffer to the output buffer.
static EnumSetting< int > BestMethodSetting