Files
raylib/src
David Reid 0aacd330d4 [raudio] Remove usage of ma_data_converter_get_required_input_frame_count() (#5568)
* Audio: Remove use of ma_data_converter_get_required_input_frame_count().

This function is being removed from miniaudio. To make this work with
the current architecture of raylib it requires the use of a cache.

This commit implements a generic solution that works across all
AudioBuffer types (static, streams and callback based), but the static
case could be optimized to avoid the cache by incorporating the
functionality of ReadAudioBufferFramesInInternalFormat() into
ReadAudioBufferFramesInMixingFormat(). It would be unpractical to avoid
the cache with streams and callback-based AudioBuffers however so this
commit sticks with a generic solution.

* Audio: Correct usage of miniaudio's dynamic rate adjustment.

This affects pitch shifting. The output rate is being modified with
ma_data_converter_set_rate(), but then that value is being used in the
computation of the output rate the next time SetAudioBufferPitch() which
results in a cascade. The correct way to do this is to use an anchored
output rate as the basis for the calculation after pitch shifting. In
this case, it's the device's sample rate that acts as the anchor.

* Audio: Optimize memory usage for data conversion.

This reduces the per-AudioBuffer conversion cache from 256 PCM frames
down to 8.
2026-02-20 13:46:41 +01:00
..
2026-02-12 19:08:48 +01:00
2026-01-10 12:20:26 +01:00
2026-02-14 22:17:49 +01:00
2025-12-30 22:05:37 +01:00
2025-01-01 00:02:52 +01:00
2025-01-01 00:02:52 +01:00
2024-11-14 16:40:04 +01:00
2025-01-01 00:02:52 +01:00
2025-01-01 00:02:52 +01:00
2026-02-14 22:16:09 +01:00
2026-01-02 13:40:15 +01:00
2026-01-02 13:40:15 +01:00
2026-02-20 11:46:46 +01:00
2026-02-14 22:22:31 +01:00
2026-01-09 23:09:06 +01:00