ofxSteamAudio provides C++ wrappers for the Steam Audio C API to enable physics-based 3D audio in openFrameworks applications.
README
ofxSteamAudio
Physics-based 3D audio for openFrameworks — Steam Audio 4.8.1 (Phonon C API)
RAII C++ wrappers covering the public Steam Audio C API, plus interactive examples that mirror Valve’s integration tests (
core/src/itest).Features
| Area | Wrapper types | Steam Audio itest |
|---|---|---|
| Context / memory | Context | memory, log |
| Audio buffers | AudioBuffer | AudioBuffer |
| HRTF | HRTF | HRTFDatabase |
| Binaural | BinauralEffect | binauraleffect |
| Panning | PanningEffect | panningeffect |
| Virtual surround | VirtualSurroundEffect | virtualsurroundeffect |
| Ambisonics | Encode / Panning / Binaural / Rotation / Decode | ambisonics |
| Direct path | DirectEffect + Simulator | directsoundeffect, directsimulator |
| Reflections | ReflectionEffect, ReflectionMixer | parametricreverb, reverbeffect, convolutioneffect |
| Pathing | PathEffect, probes, bakers | pathing, probes |
| Scene | Scene, static / instanced mesh | scene, staticmesh, instancedmesh |
| Energy / IR | EnergyField, ImpulseResponse, Reconstructor | energyfield, impulseresponse |
| High-level | Engine | multi-source binaural demo |
Layout
src/ # wrappers (include ofxSteamAudio.h)
libs/steamaudio/ # headers + prebuilt libphonon (+ mysofa, pffft)
examples/
simple-example/ # Binaural HRTF multi-source
example-panning/ # Stereo panning
example-ambisonics/ # Ambisonics encode → binaural
example-virtual-surround/ # 5.1 → binaural
example-direct/ # Occlusion + direct effect
example-scene/ # Static + instanced meshes
example-reflections/ # Parametric reverb
example-pathing/ # Probe generation + path scaffolding
tests/api-tests/ # Headless coverage of all wrappers
.github/workflows/macos.yml # CI: macOS build + run testsQuick start
#include "ofxSteamAudio.h"
ofxSteamAudio::Engine audio;
void setup() {
audio.setup(44100, 512);
int id = audio.addSource(glm::vec3(2, 0, 0));
audio.setSourceFrequency(id, 220.0f);
ofSoundStreamSettings s;
s.numOutputChannels = 2;
s.sampleRate = 44100;
s.bufferSize = 512;
s.setOutListener(this);
soundStream.setup(s);
}
void update() {
audio.setListener(cam);
audio.updateSource(0, sourceWorldPos);
}
void audioOut(ofSoundBuffer& buffer) {
audio.processAudio(buffer); // synthesizes tones + binaural spatialize
}Low-level API (full control):
ofxSteamAudio::Context ctx;
ofxSteamAudio::HRTF hrtf;
ofxSteamAudio::BinauralEffect binaural;
// ctx.setup(); hrtf.create(ctx, audioSettings); binaural.create(ctx, audioSettings, hrtf);
// binaural.apply(direction, hrtf, monoIn.get(), stereoOut.get());Building
Requires openFrameworks (tested with modern OF on macOS arm64/x86_64).
1. Get Steam Audio binaries
Prebuilt libs are not committed to git. Use the library manager:
./scripts/manage_libs.sh| Menu | Who | What |
|---|---|---|
| 1 Download from release tag | Consumers | Pull libs-v4.8.1 assets (default install) |
| 2 Build with apothecary | Maintainers | Standalone apothecary only (no full OF) |
| 3 Package | Maintainers | Write scripts/dist/steamaudio-.tar.gz |
| 4 Upload | Maintainers | gh release upload to tag libs-v |
| 5 Build + package + upload | Maintainers | Full local pipeline for one platform |
./scripts/download_libs.sh host # this machine
./scripts/download_libs.sh osx
./scripts/build_libs.sh osx # clones openframeworks/apothecary if needed
./scripts/package_libs.sh osx
./scripts/manage_libs.sh upload libs-v4.8.1
./scripts/manage_libs.sh list # full platform matrix
./scripts/manage_libs.sh statusbuild_libs.sh does not need openFrameworks — only openframeworks/apothecary (APOTHECARY_DIR / auto-cache).Platforms (OF ∩ Steam Audio + OF extras): osx, linux64, linuxaarch64, vs-x64, ios, android-\, emscripten-\, plus experimental/planned rows — see
scripts/platforms.sh.2. Build examples / tests
cd examples/simple-example && make -j
cd tests/api-tests && make -j Release && make RunReleaseLink notes (macOS)
addon_config.mk pulls libphonon (+ libmysofa / libpffft when present), zlib, Accelerate, AudioToolbox, CoreAudio. Default ray tracer (no Embree) works on Apple Silicon.Platform tracking & releases
Live matrix:
PLATFORM_STATUS.md (regenerated by CI / scripts)../scripts/manage_libs.sh list # platforms + GHA runners
./scripts/manage_libs.sh report # local + release probe → PLATFORM_STATUS.md
./scripts/test_package.sh osx # layout test (no OF)| Workflow | OF? | Purpose |
|---|---|---|
| CI | No | Probe every release asset; download+test those present; write status (failures tracked, missing = warning) |
| CI optional OF job | Yes | Dispatch with run_of_tests=true |
| Build Steam Audio libs | No — apothecary only | Build all CI-mapped platforms (continue-on-error); package successes; aggregate PLATFORM_STATUS.md; optional upload to libs-v |
1. Actions → Build Steam Audio libs (apothecary) → Run
upload_release: true,libs_tag: libs-v4.8.1- Filter:
all/full/experimental
PLATFORM_STATUS.md 4. Only successful .tar.gz files are uploaded to the release 5. CI then tracks which assets exist / pass package tests Asset name:
steamaudio-4.8.1-<package_id>.tar.gz Steam Audio
- Steam Audio GitHub
- C API docs
- Version: 4.8.1 (
STEAMAUDIO_VERSIONfromphonon_version.h)
License
Addon code: see
LICENSE. Steam Audio: Apache 2.0 — see libs/steamaudio/license/. Get this addon
Latest release
Prebuilt Steam Audio libs for ofxSteamAudio (apothecary-only).
Install:
Install:
./scripts/download_libs.sh hostPlatform status
Matrix
| Package | Support | CI runner | Build | Package test | Release asset | Notes |
|---|---|---|---|---|---|---|
osx | full | macos-14 | fail | skipped | missing | build_libs exit 1 |
linux64 | full | ubuntu-22.04 | fail | skipped | missing | build_libs exit 1 |
linuxaarch64 | full | ubuntu-24.04-arm | fail | skipped | missing | build_libs exit 1 |
linuxarmv7l | experimental | none | unknown | unknown | missing | |
vs-x64 | full | windows-2022 | fail | skipped | missing | build_libs exit 1 |
vs-arm64 | experimental | windows-11-arm | fail | skipped | missing | build_libs exit 1 |
vs-x86 | experimental | windows-2022 | fail | skipped | missing | build_libs exit 1 |
msys2 | experimental | windows-2022 | fail | skipped | missing | build_libs exit 1 |
ios | full | macos-14 | fail | skipped | missing | build_libs exit 1 |
ios-sim | experimental | macos-14 | fail | skipped | missing | build_libs exit 1 |
tvos | experimental | macos-14 | fail | skipped | missing | build_libs exit 1 |
android-arm64 | full | ubuntu-22.04 | fail | skipped | missing | build_libs exit 1 |
android-armv7 | full | ubuntu-22.04 | fail | skipped | missing | build_libs exit 1 |
android-x86 | experimental | ubuntu-22.04 | fail | skipped | missing | build_libs exit 1 |
android-x86_64 | experimental | ubuntu-22.04 | fail | skipped | missing | build_libs exit 1 |
emscripten-wasm | experimental | ubuntu-22.04 | fail | skipped | missing | build_libs exit 1 |
emscripten-wasm64 | experimental | ubuntu-22.04 | fail | skipped | missing | build_libs exit 1 |
watchos | planned | macos-14 | fail | skipped | missing | build_libs exit 1 |
xros | planned | macos-14 | fail | skipped | missing | build_libs exit 1 |
| `ca |
ofxAddons