54 [[nodiscard]]
static SAudio Import(
const std::filesystem::path& path);
72 void ExportWAV(
const std::filesystem::path& path)
const;
Contains macros and definitions for fixed-width types.
std::uint16_t u16
16-bit unsigned integer
Definition fixed_type.hpp:62
std::uint32_t u32
32-bit unsigned integer
Definition fixed_type.hpp:60
static SAudio Import(BufferView buffer)
Constructs an audio asset from a WAV file in the buffer.
void ToMono()
Converts stereo audio to mono.
std::vector< i16 > pcm
The PCM audio data stored as 16-bit samples.
Definition saudio.hpp:45
static SAudio Import(const std::filesystem::path &path)
Constructs an audio asset from a WAV file located at the specified file path.
Buffer ExportWAV() const
Exports the audio data to a WAV file.
u32 sample_rate
The sample rate of the audio (per second)
Definition saudio.hpp:41
u16 num_channels
The number of audio channels (1 for mono, 2 for stereo).
Definition saudio.hpp:43
void ExportWAV(const std::filesystem::path &path) const
Exports the audio data to a WAV file.
std::string name
An optional name of the audio asset.
Definition saudio.hpp:39
Represents a simple audio asset.
Definition saudio.hpp:38
Provides classes for reading and writing binary data to and from various sources.
Definition exception.hpp:56