1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:47:35 +00:00

LibAudio+LibRIFF: Move general RIFF handling to LibRIFF

This splits the RIFFTypes header/TU into the WAV specific parts, which
move to WavTypes.h, as well as the general RIFF parts which move to the
new LibRIFF.

Sidenote for the spec comments: even though they are linked from a site
that explains the WAV format, the document is the (an) overall RIFF spec
from Microsoft. A better source may be used later; the changes to the
header are as minimal as possible.
This commit is contained in:
kleines Filmröllchen 2023-10-12 15:02:39 +02:00 committed by Andrew Kaster
parent 015c47da51
commit d125d16287
11 changed files with 53 additions and 33 deletions

View file

@ -7,6 +7,7 @@
#include <AK/Endian.h>
#include <LibAudio/WavLoader.h>
#include <LibAudio/WavTypes.h>
#include <LibAudio/WavWriter.h>
namespace Audio {
@ -111,7 +112,7 @@ ErrorOr<void> WavWriter::write_header()
static u32 fmt_size = 16;
TRY(m_file->write_value(fmt_size));
static u16 audio_format = to_underlying(RIFF::WaveFormat::Pcm);
static u16 audio_format = to_underlying(Wav::WaveFormat::Pcm);
TRY(m_file->write_value(audio_format));
TRY(m_file->write_value(m_num_channels));