Skip to content

Your first steps

By the end of this page you'll have a sound that fades with distance, echoes in a room and goes muffled behind a wall.

Try the demo first

Open addons/spatial_audio_extended/demo/sound_lab.tscn and press F6. Walk with W A S D and the mouse, press E to fire sounds or open a door, and Tab for the debug panel. Every feature has its own room in the Sound Lab.

You can also play it in your browser. Click to look around. It runs best in Chrome or Edge on a desktop.

1. Swap in a SpatialAudioPlayer3D

Already have an AudioStreamPlayer3D? Right-click it in the scene tree, choose Change Type and pick SpatialAudioPlayer3D. Its stream, bus, autoplay and other settings carry over.

Starting fresh:

  1. Click Add Child Node and pick SpatialAudioPlayer3D.
  2. Drag an audio file onto its Stream property.
  3. Turn on Autoplay if you want it to start with the scene.

Your code doesn't change. play(), stop() and is_playing() work as before.

$Radio.play()

Volume is set for you

The player sets volume_db itself every frame, so changing it does nothing. Use max_db to set how loud the sound can get.

2. Set how far it carries

With the player selected, open the Attenuation group in the Inspector:

Property What it does Try
inner_radius Full volume inside this distance 2 m
falloff_distance How far past the inner radius it fades to silence 20 m
attenuation_function The shape of the fade NATURAL_SOUND

Then, under Ray Distribution, set max_raycast_distance to at least inner_radius + falloff_distance (22 m here).

While the player is selected, the viewport shows the inner radius as a cyan sphere and the outer edge as an orange one, so you can size them by eye.

3. Hear the room

Room Size Reverb and Occlusion are on by default. Press F6 to run the scene and walk around:

  • In a small room the sound is dry. In a large hall it echoes.
  • Step behind a wall and the sound goes muffled and quieter.
  • Outdoors, with nothing for the rays to hit, the reverb fades out.

The rays only see collision shapes, so your walls and floors need a StaticBody3D with a CollisionShape3D, or a CSG shape with Use Collision turned on.

4. Give your walls materials

Every surface sounds the same until you tell the plugin what it's made of:

  1. Select a wall's StaticBody3D (or CSG shape).
  2. Click AcousticBody in the 3D editor toolbar. The plugin adds an AcousticBody child and selects it.
  3. In the Inspector, load a preset into Acoustic Material, for example addons/spatial_audio_extended/presets/materials/concrete.tres.

Now a carpeted room sounds dead, a tiled bathroom rings, and a glass window lets more sound through than a brick wall. See Surfaces and materials.

5. Check it with the debug panel

Under Debug, turn on display_debug_info and run the scene. A panel in the top left shows the distance, wall count, reverb and volume live. Press F1 to switch all effects off and on and hear the difference. See Debug tools.

Next: Surfaces and materials, or browse the rest of the docs from the menu on the left.