ladybird/Userland/Applications/SoundPlayer
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
..
AudioAlgorithms.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
AudioAlgorithms.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
BarsVisualizationWidget.cpp Userland: Don't explicitly call Vector<T>::is_null() 2021-05-16 17:49:42 +02:00
BarsVisualizationWidget.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
CMakeLists.txt Everywhere: Add component declarations 2021-06-17 11:03:51 +02:00
Common.h SoundPlayer: Fix playback slider page stepping 2021-06-02 09:39:30 +02:00
M3UParser.cpp Everywhere: Remove empty line after function body opening curly brace 2021-04-25 20:20:00 +02:00
M3UParser.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
main.cpp LibIPC: Remove unnecessary IPC::ServerConnection::handshake() 2021-05-23 09:53:55 +02:00
NoVisualizationWidget.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
NoVisualizationWidget.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
PlaybackManager.cpp SoundPlayer: Handle any input file sample rate 2021-06-21 03:13:59 +04:30
PlaybackManager.h SoundPlayer: Handle any input file sample rate 2021-06-21 03:13:59 +04:30
Player.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
PlaylistWidget.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
PlaylistWidget.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SampleWidget.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SampleWidget.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SoundPlayerWidgetAdvancedView.cpp SoundPlayer: Handle any input file sample rate 2021-06-21 03:13:59 +04:30
SoundPlayerWidgetAdvancedView.h SoundPlayer: Handle any input file sample rate 2021-06-21 03:13:59 +04:30
VisualizationBase.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00