ladybird/Userland/Libraries/LibAudio
Nick Miller 9a2c80c791 SoundPlayer: Handle any input file sample rate
This commit addresses two issues:
1. If you play a 96 KHz Wave file, the slider position is incorrect,
   because it is assumed all files are 44.1 KHz.
2. For high-bitrate files, there are audio dropouts due to not
   buffering enough audio data.

Issue 1 is addressed by scaling the number of played samples by the
ratio between the source and destination sample rates.

Issue 2 is addressed by buffering a certain number of milliseconds
worth of audio data (instead of a fixed number of bytes).
This makes the the buffer size independent of the source sample rate.

Some of the code is redesigned to be simpler. The code that did the
book-keeping of which buffers need to be loaded and which have been
already played has been removed. Instead, we enqueue a new buffer based
on a low watermark of samples remaining in the audio server queue.

Other small fixes include:
1. Disable the stop button when playback is finished.
2. Remove hard-coded instances of 44100.
3. Update the GUI every 50 ms (was 100), which improves visualizations.
2021-06-21 03:13:59 +04:30
..
Buffer.cpp LibAudio: Support 32 and 64-bit float WAV files 2021-04-26 19:08:40 +02:00
Buffer.h LibAudio: Support 32 and 64-bit float WAV files 2021-04-26 19:08:40 +02:00
ClientConnection.cpp SoundPlayer: Handle any input file sample rate 2021-06-21 03:13:59 +04:30
ClientConnection.h Userland: Mark subclasses of IPC::{Client,Server}Connection final 2021-05-23 09:53:55 +02:00
CMakeLists.txt Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Loader.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Loader.h LibAudio: Avoid reading past the end of sample data 2021-06-21 03:13:59 +04:30
WavLoader.cpp SoundPlayer: Handle any input file sample rate 2021-06-21 03:13:59 +04:30
WavLoader.h SoundPlayer: Handle any input file sample rate 2021-06-21 03:13:59 +04:30
WavWriter.cpp LibCore+Everywhere: Move OpenMode out of IODevice 2021-05-12 11:00:45 +01:00
WavWriter.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00