RetroArch/audio
Felipe Tavares ea81928e39
Fast-Forward Audio Resampling (#15173)
* 🎵 Fast forward audio resampling. Solves #15160.

Previously, we avoided doing any resampling while fastforwarding based
on the assumption it was impossible to make the audio not crackle due to
both flush-to-flush timing fluctuations and timer accuracy.

However, turns out this is not the case. The audio doesn't "crackle" per
se when the timing fluctuates! It's just that the sounds don't make
sense since the time compression and decompression caused by the flush
time fluctuations mess with the audio consistency.

To work around that, we introduce a running average flush delta time
that makes sure the audio is both resampled to approximately the correct
rate and consistent.

This was tested in two settings:

- Limited rate fastforwarding (2x-4x)
- Unlimited fastforwarding

In both cases it seems to work well, but with unlimited fastforwarding
it's just high pitched and annoying, so this is probably the most useful
in the 2x to 4x range.

* Move declartion to support C89

* resampling ratio upper and lower bounds

* Add toggle for speeding up audio
2023-04-20 17:14:47 +02:00
..
common (XAudio 2.8) Audio device selection can now be set 2019-07-26 20:46:11 +02:00
drivers WASAPI Frame Delay fix + cleanups (#15187) 2023-04-13 20:20:47 +02:00
drivers_resampler Add intrinsic NEON versions for float_to_s16/s16_to_float (#12933) 2021-09-04 00:25:21 +02:00
audio_defines.h Fast-Forward Audio Resampling (#15173) 2023-04-20 17:14:47 +02:00
audio_driver.c Fast-Forward Audio Resampling (#15173) 2023-04-20 17:14:47 +02:00
audio_driver.h Fast-Forward Audio Resampling (#15173) 2023-04-20 17:14:47 +02:00
audio_thread_wrapper.c Split up audio code into new file audio/audio_driver.c (#13097) 2021-10-11 18:01:37 +02:00
audio_thread_wrapper.h Split up audio code into new file audio/audio_driver.c (#13097) 2021-10-11 18:01:37 +02:00
librsound.c Remove asserts 2023-01-09 00:51:05 +01:00