mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 08:44:04 +02:00
SRC: Add APIs for querying required input and expected output frames.
* ma_resampler_get_required_input_frame_count() * ma_resampler_get_expected_output_frame_count() These have not yet been implemented for the Speex backend. This commit also adds an APIs for setting changing the rate: * ma_resampler_set_rate() * ma_resampler_set_rate_ratio()
This commit is contained in:
+19
@@ -4331,6 +4331,25 @@ static MA_INLINE float ma_scale_to_range_f32(float x, float lo, float hi)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Greatest common factor using Euclid's algorithm iteratively.
|
||||
*/
|
||||
static MA_INLINE ma_uint32 ma_gcf_u32(ma_uint32 a, ma_uint32 b)
|
||||
{
|
||||
for (;;) {
|
||||
if (b == 0) {
|
||||
break;
|
||||
} else {
|
||||
ma_uint32 t = a;
|
||||
a = b;
|
||||
b = t % a;
|
||||
}
|
||||
}
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Random Number Generation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user