1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +00:00
serenity/Userland/Libraries/LibAudio
Nick Miller ed5777eb0a LibAudio: WavLoader: Avoid reading partial samples
When samples are requested in `Audio::Loader::get_more_samples`,
the request comes in as a max number of bytes to read.

However, the requested number of bytes may not be an even multiple
of the bytes per sample of the loaded file. If this is the case, and
the bytes are read from the file/stream, then
the last sample will be a partial/runt sample, which then offsets
the remainder of the stream, causing white noise in playback.

This bug was discovered when trying to play 24-bit Wave files, which
happened to have a sample size that never aligned with the number
of requested bytes.

This commit fixes the bug by only reading a multiple of
"bytes per sample" for the loaded file.
2021-06-08 00:38:54 +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 LibIPC: Remove unnecessary IPC::ServerConnection::handshake() 2021-05-23 09:53:55 +02:00
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: Support 32 and 64-bit float WAV files 2021-04-26 19:08:40 +02:00
WavLoader.cpp LibAudio: WavLoader: Avoid reading partial samples 2021-06-08 00:38:54 +04:30
WavLoader.h LibAudio: WavLoader: Avoid reading partial samples 2021-06-08 00:38:54 +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