mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-21 15:56:58 +02:00
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:
+8
-11
@@ -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
|
||||
`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
|
||||
retrieved in terms of both the input rate and the output rate with
|
||||
`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.
|
||||
|
||||
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
|
||||
ma_resampler_get_expected_output_frame_count() to know how many output frames will be processed for a given number of input frames.
|
||||
were actually processed, which may be less than the requested amount which will happen if there's not enough input data.
|
||||
|
||||
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
|
||||
you should provide for a given number of output frames. [pFramesIn] cannot be NULL.
|
||||
input frames that were actually processed.
|
||||
|
||||
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
|
||||
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);
|
||||
|
||||
/*
|
||||
Calculates the number of whole output frames that would be output after fully reading and consuming the specified number of
|
||||
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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
#if 0
|
||||
#if 1
|
||||
ma_uint64 inputFrameCount;
|
||||
|
||||
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)
|
||||
{
|
||||
#if 0
|
||||
#if 1
|
||||
if (pOutputFrameCount == NULL) {
|
||||
return MA_INVALID_ARGS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user