mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 08:57:47 +00:00
LibRIFF: Rework to match LibGfx needs
There's now two namespaces, RIFF (little-endian) and IFF (big-endian) which (for the most part) contain the same kinds of structures for handling similar data in both formats. (They also share almost all of their implementation) The main types are ChunkHeader and (Owned)Chunk. While Chunk has no ownership over the data it accesses (and can only be constructed from a byte view), OwnedChunk has ownership over this data and is aimed at reading from streams. OwnedList, implementing the standard RIFF LIST type, is currently only implemented for RIFF due to its only user being WAV, but it may be generalized in the future for use by IFF. Co-authored-by: Timothy Flynn <trflynn89@pm.me>
This commit is contained in:
parent
d125d16287
commit
64598473cc
11 changed files with 366 additions and 145 deletions
|
@ -14,7 +14,7 @@
|
|||
#include <AK/Span.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <LibAudio/Loader.h>
|
||||
#include <LibRIFF/Types.h>
|
||||
#include <LibRIFF/RIFF.h>
|
||||
|
||||
namespace Audio {
|
||||
|
||||
|
@ -46,7 +46,7 @@ public:
|
|||
|
||||
private:
|
||||
MaybeLoaderError parse_header();
|
||||
MaybeLoaderError load_wav_info_block(Vector<RIFF::Chunk> info_chunks);
|
||||
MaybeLoaderError load_wav_info_block(Vector<RIFF::OwnedChunk> info_chunks);
|
||||
|
||||
LoaderSamples samples_from_pcm_data(ReadonlyBytes data, size_t samples_to_read) const;
|
||||
template<typename SampleReader>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue