Skip to content

Owned PCM wave data

Generated from engine/audio/wave_data.h at aceb130. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.

Browse the audio module

Audience: game code.

#include "engine/audio/wave_data.h" · namespace labrador

enum class WaveEncoding
{
pcm8,
pcm16,
adpcm
};

The source encoding before decoding. Samples below are signed 16-bit PCM whatever this says; the value preserves their provenance.

struct WaveData

One owned wave, decoded to signed 16-bit PCM.

std::string name;

A name used to resolve this wave in a memory bank. A reader may leave it empty when the source format carries no name.

WaveEncoding encoding = WaveEncoding::pcm16;
int channels = 0;
int sample_rate = 0;
uint32_t loop_start = 0;
uint32_t loop_length = 0;

Frames, not individual interleaved samples. A zero length means no region: loop_start is ignored and a looping voice loops the whole wave. Otherwise it plays from the start, then repeats this region.

std::vector<int16_t> samples;

Interleaved: a frame is channels consecutive samples.

size_t frames() const;

An owned bank and its waves in resolution order.

std::string name;
std::vector<WaveData> waves;

The files that include this header directly. A file can also reach it through another header.

Development documentation (unreleased). Built from Labrador aceb130 of 2026-11-20.

All documentation versions