Commit graph

8 commits

Author SHA1 Message Date
Andrew Kaster
86995be111 LibAudio: Tolerate a file sample rate lower than the AudioServer's
Previously, trying to load a wav file in aplay or SoundPlayer with a
sample rate less than 44100 would crash in an assertion failure trying
to unchecked_append to a vector that was not resized properly.
2022-12-31 00:04:34 +01:00
kleines Filmröllchen
727fb305a8 LibAudio: Allow resampling into existing buffer
This alleviates some copying
and we can implement existing APIs in terms of this.
2022-12-15 00:21:00 -07:00
kleines Filmröllchen
836f28392d LibAudio: Make resampling fallible 2022-12-15 00:21:00 -07:00
kleines Filmröllchen
ab49fcfb7c LibAudio+Userland: Remove Audio::LegacyBuffer
The file is now renamed to Queue.h, and the Resampler APIs with
LegacyBuffer are also removed. These changes look large because nobody
actually needs Buffer.h (or Queue.h). It was mostly transitive
dependencies on the massive list of includes in that header, which are
now almost all gone. Instead, we include common things like Sample.h
directly, which should give faster compile times as very few files
actually need Queue.h.
2022-05-03 23:09:20 +02:00
kleines Filmröllchen
cb0e95c928 LibAudio+Everywhere: Rename Audio::Buffer -> Audio::LegacyBuffer
With the following change in how we send audio, the old Buffer type is
not really needed anymore. However, moving WavLoader to the new system
is a bit more involved and out of the scope of this PR. Therefore, we
need to keep Buffer around, but to make it clear that it's the old
buffer type which will be removed soon, we rename it to LegacyBuffer.
Most of the users will be gone after the next commit anyways.
2022-04-21 13:55:00 +02:00
Brian Gianforcaro
83e96569ed LibAudio: Make sure we initialize ResampleHelper member variables
Found by Static Analysis: Sonar Cloud
2022-03-27 16:43:05 -07:00
kleines Filmröllchen
63d9ec8e94 LibAudio: Allow resampling from any array-like type 2022-02-26 17:57:55 +01:00
kleines Filmröllchen
5d01db3493 LibAudio: Split Buffer.{h, cpp} into three files
The Buffer files had contained both the ResampleHelper and the
sample format utilities. Because the Buffer class (and its file) is
going to be deleted soon, this commit separates those two things into
their own files.
2022-02-26 17:57:55 +01:00