Component · audio
AcousticSource
Per-source acoustic behaviour, alongside
AudioSource. Optional: sources without it use AcousticSource::default().Fields
occlusion
boolTrace geometry between source and listener for occlusion and transmission.
default true
occlusionRadius
f32Radius sampled for partial (volumetric) occlusion; 0 traces only the center ray.
default 0.5m0 – 50
airAbsorption
boolApply frequency-dependent air absorption over the propagation distance.
default true
doppler
f32Doppler strength: 0 disables pitch shift, 1 is physical, larger exaggerates.
default 10 – 4
reverbSend
f32Room reverb send before zone and portal attenuation.
default 10 – 1
distanceCurve
list<vec2>Custom distance curve:
[meters, linear gain] points with increasing distance. Empty uses AudioSource.attenuation; cones still apply.default []
Usage
Every edit is an undoable command: from the CLI as below, or the same JSON from an agent over MCP. See component.add and property.set.
Add it
ara do component.add -p entity=name:Crate -p component=AcousticSource --why "Add AcousticSource"Set a field
ara do property.set -p entity=name:Crate -p path=AcousticSource.occlusion -p value=true --why "Tune AcousticSource"In a scene document
{
"AcousticSource": {
"occlusion": true
}
}From C#
/// <summary>Reduce pitch shift on a moving emitter.</summary>
public static void UseAcousticSource(Entity entity, in Tick tick)
{
ref var component = ref World.Get<AcousticSource>(entity);
component.Doppler = 0.5f;
}From C#
Scripts read and write it with Get<AcousticSource>(); see the AcousticSource struct.