Stop encouraging the use of some resampling functions.

These functions are not reliably implemented by all backends and as such
I'd rather not encourage these use of these. These might be removed in
the future.
This commit is contained in:
David Reid
2026-02-07 17:09:51 +10:00
parent 2ea55eaeaf
commit a04f300821
+8 -11
View File
@@ -2997,11 +2997,6 @@ The sample rate can be changed dynamically on the fly. You can change this with
rates with `ma_resampler_set_rate()` and also with a decimal ratio with rates with `ma_resampler_set_rate()` and also with a decimal ratio with
`ma_resampler_set_rate_ratio()`. The ratio is in/out. `ma_resampler_set_rate_ratio()`. The ratio is in/out.
Sometimes it's useful to know exactly how many input frames will be required to output a specific
number of frames. You can calculate this with `ma_resampler_get_required_input_frame_count()`.
Likewise, it's sometimes useful to know exactly how many frames would be output given a certain
number of input frames. You can do this with `ma_resampler_get_expected_output_frame_count()`.
Due to the nature of how resampling works, the resampler introduces some latency. This can be Due to the nature of how resampling works, the resampler introduces some latency. This can be
retrieved in terms of both the input rate and the output rate with retrieved in terms of both the input rate and the output rate with
`ma_resampler_get_input_latency()` and `ma_resampler_get_output_latency()`. `ma_resampler_get_input_latency()` and `ma_resampler_get_output_latency()`.
@@ -5716,12 +5711,10 @@ Converts the given input data.
Both the input and output frames must be in the format specified in the config when the resampler was initialized. Both the input and output frames must be in the format specified in the config when the resampler was initialized.
On input, [pFrameCountOut] contains the number of output frames to process. On output it contains the number of output frames that On input, [pFrameCountOut] contains the number of output frames to process. On output it contains the number of output frames that
were actually processed, which may be less than the requested amount which will happen if there's not enough input data. You can use were actually processed, which may be less than the requested amount which will happen if there's not enough input data.
ma_resampler_get_expected_output_frame_count() to know how many output frames will be processed for a given number of input frames.
On input, [pFrameCountIn] contains the number of input frames contained in [pFramesIn]. On output it contains the number of whole On input, [pFrameCountIn] contains the number of input frames contained in [pFramesIn]. On output it contains the number of whole
input frames that were actually processed. You can use ma_resampler_get_required_input_frame_count() to know how many input frames input frames that were actually processed.
you should provide for a given number of output frames. [pFramesIn] cannot be NULL.
No arguments are allowed to be NULL. No arguments are allowed to be NULL.
*/ */
@@ -5756,12 +5749,16 @@ number of output frames.
The returned value does not include cached input frames. It only returns the number of extra frames that would need to be The returned value does not include cached input frames. It only returns the number of extra frames that would need to be
read from the input buffer in order to output the specified number of output frames. read from the input buffer in order to output the specified number of output frames.
This is not implemented by all resampling backends and you should not assume it is generally available.
*/ */
MA_API ma_result ma_resampler_get_required_input_frame_count(const ma_resampler* pResampler, ma_uint64 outputFrameCount, ma_uint64* pInputFrameCount); MA_API ma_result ma_resampler_get_required_input_frame_count(const ma_resampler* pResampler, ma_uint64 outputFrameCount, ma_uint64* pInputFrameCount);
/* /*
Calculates the number of whole output frames that would be output after fully reading and consuming the specified number of Calculates the number of whole output frames that would be output after fully reading and consuming the specified number of
input frames. input frames.
This is not implemented by all resampling backends and you should not assume it is generally available.
*/ */
MA_API ma_result ma_resampler_get_expected_output_frame_count(const ma_resampler* pResampler, ma_uint64 inputFrameCount, ma_uint64* pOutputFrameCount); MA_API ma_result ma_resampler_get_expected_output_frame_count(const ma_resampler* pResampler, ma_uint64 inputFrameCount, ma_uint64* pOutputFrameCount);
@@ -59857,7 +59854,7 @@ MA_API ma_uint64 ma_linear_resampler_get_output_latency(const ma_linear_resample
MA_API ma_result ma_linear_resampler_get_required_input_frame_count(const ma_linear_resampler* pResampler, ma_uint64 outputFrameCount, ma_uint64* pInputFrameCount) MA_API ma_result ma_linear_resampler_get_required_input_frame_count(const ma_linear_resampler* pResampler, ma_uint64 outputFrameCount, ma_uint64* pInputFrameCount)
{ {
#if 0 #if 1
ma_uint64 inputFrameCount; ma_uint64 inputFrameCount;
if (pInputFrameCount == NULL) { if (pInputFrameCount == NULL) {
@@ -59938,7 +59935,7 @@ static ma_result ma_linear_resampler_get_expected_output_frame_count_ex(ma_uint3
MA_API ma_result ma_linear_resampler_get_expected_output_frame_count(const ma_linear_resampler* pResampler, ma_uint64 inputFrameCount, ma_uint64* pOutputFrameCount) MA_API ma_result ma_linear_resampler_get_expected_output_frame_count(const ma_linear_resampler* pResampler, ma_uint64 inputFrameCount, ma_uint64* pOutputFrameCount)
{ {
#if 0 #if 1
if (pOutputFrameCount == NULL) { if (pOutputFrameCount == NULL) {
return MA_INVALID_ARGS; return MA_INVALID_ARGS;
} }