Getting started

Maul Audio has two parts that build and work apart. The Device part moves interleaved float frames between a program and the platform's audio devices. The Spatial part renders sources in space for headphones or speakers. A program links the part it uses.

Requirements

Building

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
ctest --test-dir build
cmake --install build --prefix /usr/local

A program finds the installed package with CMake:

find_package(maul-audio REQUIRED CONFIG)
target_link_libraries(app PRIVATE maul-audio::maul-audio)

or with pkg-config as maul-audio (add --static for the static library). samples/minimal is such a program, a project that knows only the installed package.

Build options

Option Default What it does
MAUL_AUDIO_DEVICE ON The Device part: contexts, devices, streams, voice processing.
MAUL_AUDIO_SPATIAL ON The Spatial part: HRTF sets, effects, the ambisonic bed, the spatializer.
MAUL_AUDIO_BUILD_SHARED OFF A shared library instead of a static one.
MAUL_AUDIO_PIPEWIRE, MAUL_AUDIO_PULSE, MAUL_AUDIO_ALSA ON on Linux Each Linux backend.
MAUL_AUDIO_WASAPI, MAUL_AUDIO_COREAUDIO, MAUL_AUDIO_IOS, MAUL_AUDIO_AAUDIO on their platform The other native backends.
MAUL_AUDIO_PRIVATE_BACKEND empty A directory holding a backend kept outside the library; see Private backends.
MAUL_AUDIO_BUILD_TESTS, MAUL_AUDIO_BUILD_BENCH, MAUL_AUDIO_BUILD_SAMPLES, MAUL_AUDIO_INSTALL ON at the top level Tests, benchmarks, samples and install rules; off when the library is added to another project.

-DMAUL_AUDIO_SPATIAL=OFF builds the Device part alone, -DMAUL_AUDIO_DEVICE=OFF the Spatial part alone. Neither part's code calls the other's.

The model

Opening a context

maudContextDef def = maudDefaultContextDef();   // the platform's backend
maudContext* context = NULL;
maudResult made = maudCreateContext(&def, &context);
if (made != maud_success)
{
    // maud_errorUnsupported: no backend runs here, such as a Linux
    // machine without an audio service.
}

From there, Devices and streams continues with the Device part and Spatial audio with the Spatial part.

Samples