-
Notifications
You must be signed in to change notification settings - Fork 8
Project setup
stechyo edited this page Jun 11, 2024
·
5 revisions
Check the demo project on each release for a decent integration example. Your scene should have:
- A SteamAudioConfig node. Nothing will happen if this node isn't in the scene, and having it allows you to configure some overall settings.
- For each static mesh that you want to enable for sound occlusion and reflection, you'll want to add a SteamAudioGeometry node. You can either add it to a
MeshInstance3D
or aCollisionShape3D
that has a sphere, cylinder, box, capsule or concave polygon shape. You don't gain anything by adding it to both nodes on the same mesh, so you ideally want to add it to theCollisionShape3D
node (that node, hopefully, has a lot less polygons than your mesh, unless it's a very low-poly mesh - if it doesn't, consider changing that, as you're probably burning performance pointlessly whether you're using this extension or not). You can configure the material on this node to allow for more or less sound to pass through it, or to tweak how much sound it reflects (see SteamAudioMaterial). The extension comes with the material presets that feature in Valve's official SteamAudio plugin for Unity. - You need one SteamAudioListener node in the place where you'll want to simulate a listener. This is probably your camera, so put it as a child of your
Camera3D
node. Multiple listeners are not supported, and neither are zero. - For each audio source that you'd like to apply sound effects to, you must use a SteamAudioPlayer node instead of e.g. an
AudioStreamPlayer3D
. In this node you can configure different settings and toggle SteamAudio effects. If you want to change the player's stream at runtime, see SteamAudioPlayer. Note that, if you don't need the spatial audio effects offered by this extension in a particular audio source, you are probably better off using anAudioStreamPlayer3D
.