1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-13 22:17:36 +00:00
serenity/Userland/Libraries/LibAudio
Zaggy1024 ac6c06e235 LibAudio: Don't count buffered samples in Loader::loaded_samples()
The `Loader` uses a `Vector<Sample>` to store any samples that the
actual audio decoder returned that the loader client did not request
yet. However, it did not take that buffer into account when those
clients asked for the number of samples loaded. The buffer is an
internal implementation detail, and should not be reflected on the
external API.

This allows LibWeb to keep better track of audio position without any
desync caused by the buffer. When using the Serenity `PlaybackStream`
implementation as the back end for an `HTMLAudioElement`, this allows
us to perfectly stop on the exact last sample of the audio file, so it
will not stop before the media element can see that it has finished
playback.

Note that `Loader::get_more_samples()` also calls `loaded_samples()` to
determine how many samples are remaining to load into the output
buffer. However, this change appears to be correct even there, given
that the samples copied from the internal sample buffer are included in
that count.
2023-08-29 11:31:10 +02:00
..
CMakeLists.txt LibAudio: Add a Serenity implementation of PlaybackStream 2023-08-29 11:31:10 +02:00
ConnectionToManagerServer.cpp AudioServer+Userland: Separate audio IPC into normal client and manager 2023-06-25 00:16:44 +02:00
ConnectionToManagerServer.h AudioServer+Userland: Separate audio IPC into normal client and manager 2023-06-25 00:16:44 +02:00
ConnectionToServer.cpp LibAudio: Add a Serenity implementation of PlaybackStream 2023-08-29 11:31:10 +02:00
ConnectionToServer.h LibAudio: Add a Serenity implementation of PlaybackStream 2023-08-29 11:31:10 +02:00
Encoder.h LibAudio: Allow adding metadata to encoders 2023-08-29 10:43:34 +02:00
FlacLoader.cpp LibAudio: Add a FLAC encoder 2023-08-12 12:25:26 -06:00
FlacLoader.h LibAudio: Optimize FlacLoader by avoiding allocations 2023-07-06 19:13:36 +01:00
FlacTypes.h LibAudio: Add a FLAC encoder 2023-08-12 12:25:26 -06:00
FlacWriter.cpp LibAudio: Write FLAC metadata 2023-08-29 10:43:34 +02:00
FlacWriter.h LibAudio: Write FLAC metadata 2023-08-29 10:43:34 +02:00
Forward.h LibAudio: Add more common classes to the forward declare header 2023-08-29 10:43:34 +02:00
GenericTypes.cpp LibAudio: Don't return a seek point if it is after the desired sample 2023-07-06 14:27:57 +01:00
GenericTypes.h LibAudio: Prevent multiple kinds of buffer overruns in FLAC picture load 2023-07-04 12:47:08 +02:00
Loader.cpp LibAudio: Don't count buffered samples in Loader::loaded_samples() 2023-08-29 11:31:10 +02:00
Loader.h LibAudio: Don't count buffered samples in Loader::loaded_samples() 2023-08-29 11:31:10 +02:00
LoaderError.h LibAudio: Stop using and remove LOADER_TRY 2023-07-04 13:24:17 -06:00
Metadata.cpp LibAudio: Add a generic audio metadata container 2023-03-13 12:35:17 -04:00
Metadata.h LibAudio: Add a generic audio metadata container 2023-03-13 12:35:17 -04:00
MP3HuffmanTables.h LibAudio: Handle bitstream errors in MP3 Huffman decode 2023-07-02 02:15:32 +02:00
MP3Loader.cpp LibAudio: Remove unnecessary m_bitstream field from MP3Loader 2023-08-26 18:43:23 -04:00
MP3Loader.h LibAudio: Remove unnecessary m_bitstream field from MP3Loader 2023-08-26 18:43:23 -04:00
MP3Tables.h LibAudio+LibDSP: Switch samples to 32-bit float instead of 64-bit float 2022-05-07 20:20:16 +02:00
MP3Types.h LibAudio: Accurately skip MP3 frames using the actual header size 2023-08-26 18:43:23 -04:00
MultiChannel.h LibAudio: Optimize FlacLoader by avoiding allocations 2023-07-06 19:13:36 +01:00
PlaybackStream.cpp LibAudio: Add a Serenity implementation of PlaybackStream 2023-08-29 11:31:10 +02:00
PlaybackStream.h LibAudio: Create a playback class with a PulseAudio implementation 2023-08-04 13:49:36 -06:00
PlaybackStreamPulseAudio.cpp LibAudio: Remove the strong reference to the PulseAudio control thread 2023-08-07 10:40:34 -06:00
PlaybackStreamPulseAudio.h LibAudio: Remove the strong reference to the PulseAudio control thread 2023-08-07 10:40:34 -06:00
PlaybackStreamSerenity.cpp LibAudio: Add a Serenity implementation of PlaybackStream 2023-08-29 11:31:10 +02:00
PlaybackStreamSerenity.h LibAudio: Add a Serenity implementation of PlaybackStream 2023-08-29 11:31:10 +02:00
PulseAudioWrappers.cpp LibAudio: Add a test for creating and destructing a PlaybackStream 2023-08-07 10:40:34 -06:00
PulseAudioWrappers.h LibAudio: Add a test for creating and destructing a PlaybackStream 2023-08-07 10:40:34 -06:00
QOALoader.cpp LibAudio: Stop using and remove LOADER_TRY 2023-07-04 13:24:17 -06:00
QOALoader.h LibAudio: Extract loader stream creation from the plugins 2023-06-27 15:28:22 +01:00
QOATypes.cpp LibAudio: Implement the Quite Okay Audio format 2023-03-10 04:07:14 -07:00
QOATypes.h LibAudio: Implement the Quite Okay Audio format 2023-03-10 04:07:14 -07:00
Queue.h LibAudio+Userland: Remove Audio::LegacyBuffer 2022-05-03 23:09:20 +02:00
Resampler.h LibAudio: Tolerate a file sample rate lower than the AudioServer's 2022-12-31 00:04:34 +01:00
RIFFTypes.cpp LibAudio: Load WAV metadata 2023-05-31 16:23:07 +02:00
RIFFTypes.h LibAudio: Load WAV metadata 2023-05-31 16:23:07 +02:00
Sample.h Piano: Use Sample struct from LibDSP 2023-08-04 12:56:27 +02:00
SampleFormats.cpp LibAudio: Add integer sample format-specific support 2023-08-12 12:25:26 -06:00
SampleFormats.h LibAudio: Add integer sample format-specific support 2023-08-12 12:25:26 -06:00
UserSampleQueue.cpp LibAudio: Prevent int overflow in the user buffer queue 2022-12-31 00:08:05 +01:00
UserSampleQueue.h Everywhere: Remove unused includes of AK/Format.h 2023-01-02 20:27:20 -05:00
VorbisComment.cpp LibAudio: Allow writing Vorbis comments 2023-08-29 10:43:34 +02:00
VorbisComment.h LibAudio: Allow writing Vorbis comments 2023-08-29 10:43:34 +02:00
WavLoader.cpp LibAudio: Understand album (IPRD) metadata in WAV 2023-08-29 10:43:34 +02:00
WavLoader.h LibAudio: Use ReadonlyBytes instead of Bytes for buffer parameters 2023-07-20 08:02:12 +01:00
WavWriter.cpp LibAudio: Use Encoder interface for WavWriter 2023-08-12 12:25:26 -06:00
WavWriter.h LibAudio: Use Encoder interface for WavWriter 2023-08-12 12:25:26 -06:00