Skip to main content
Euca’s audio system (euca-audio) wraps Kira for mixing: global and spatial (3D) sources, per-bus routing, distance attenuation, reverb zones, occlusion, sound priority/concurrency, and fading. The route logic is headless, but actual playback needs an OS audio device — not a GPU.
Audio needs an OS audio device. The AudioEngine holds a Kira AudioManager bound to the machine’s audio hardware. The route logic (load a clip, spawn a source, track state) is headless, but a machine with no audio device will fail at AudioEngine::new(). The headless example server does not register an audio engine by default — audio is a client-side concern.

What it does

  • SourcesAudioSource::global() or AudioSource::spatial(clip, max_distance); volume, looping, bus assignment.
  • BusesMaster / Music / Sfx / Voice / Ui, each with independent volume.
  • Spatial — distance attenuation (quadratic falloff) relative to an AudioListener entity’s GlobalTransform; ReverbZones and AudioOcclusion for line-of-sight muffling.
  • Mixing policyAudioSettings caps concurrent sounds and sets an occlusion factor; fading uses Kira tweens.
  • Fork-safe — the engine is shared as Arc<Mutex<AudioEngine>> so a forked world reuses the same audio engine rather than cloning a device handle.

Endpoints

MethodPathDescription
POST/audio/playLoad a clip and spawn an audio source (global or spatial)
POST/audio/stopStop a playing source by entity ID
GET/audio/listList active sources (clip, volume, spatial flag)

Example

# Play a spatial sound at an entity, then list active sources
curl -s -X POST http://localhost:3917/audio/play \
  -H 'Content-Type: application/json' \
  -d '{"path":"assets/sfx/explosion.ogg","spatial":true,"max_distance":40,"bus":"Sfx"}'

curl -s http://localhost:3917/audio/list

Status

  • ✅ Clip loading, global + spatial playback, distance attenuation, bus routing + per-bus volume, sound concurrency, fading, reverb zones, occlusion — shipped. Playback requires a host with an audio device.

Audio endpoints

Play, stop, and list endpoints with schemas.