In a realistic acoustic environment, sounds coming from an enclosed space will transmit through the walls, and will also come out from openings, such as doors and windows. Spatial Audio will simulate this effect with a high-level geometry abstraction called Rooms and Portals.
Wwise Project
- In the Wwise project, create new Auxiliary Busses for each of the rooms.
- Right-click where you want to add a child Auxiliary Bus
Navigate to New Child > Presets and select Room Auxiliary Bus
- In the Effects tab, you can tweak the RoomVerb Effect.
- Save the project and generate SoundBanks.
Unreal Project
- In Unreal, drag and drop the new Auxiliary Busses from the Wwise Browser to the Content Browser.
- If not done already in another tutorial, drag and drop two AkSpatialAudioVolume objects for each room of the building. We will use Fit To Geometry to place the two rooms.
- Enable Fit To Geometry in the Details panel of each
AkSpatialAudioVolume
.
- If the initial shape that is found is not satisfactory, translate the
AkSpatialAudioVolume
to a new location using the transform gizmo. Notice that a yellow preview outline appears when translating the AkSpatialAudioVolume. When a satifactory shape is found, release the mouse button and the AkSpatialAudioVolume will snap into place.
- For more information on placing
AkSpatialAudioVolumes
using Fit To Geometry, refer to Fit to Geometry.
- Make sure that Enable Room and Enable Late Reverb are enabled for the two
AkSpatialAudioVolume
objects.
- If you didn't do the Reflect tutorial, leave Enable Surface Reflectors unchecked.
- In the Late Reverb Section, uncheck Auto Assign Aux Bus and drag and drop the newly imported Auxiliary Bus from the Content Browser to the Aux Bus parameter.
Add two AkAcousticPortal objects
- Place them around the openings of the building.
- To facilitate placement of an AkAcousticPortal, enable the Fit To Geometry check box in the Details panel.
- When Fit To Geometry is enabled, the integration will attempt to find a logical placement for the portal using the surrounding geometry. A yellow preview outline will appear when dragging the
AkAcousticPortal
near an appropriate opening using the transform gizmo. When a satisfactory placement is found, release the mouse button and the AkAcousticPortal will snap to place.
- For more information on placing
AkAcousticPortals
using Fit To Geometry, refer to Fit to Geometry.
- After an
AkAcousticPortal
is placed inside each doorway, adjust the depth of each portal using the scale gizmo to achieve the desired crossfade distance. A deeper portal (along its local X-axis) will result in a longer crossfade distance when an AkComponent
transitions through the portal. This is true for both reverb sends and spread transition.
- Select the portals and set their Initial State to Enabled in the Ak Portal Component section. In the Obstruction Occlusion section, set the Initial Occlusion and Obstruction Refresh Interval to 0.0.
| Note:
An AkAcousticPortal must be oriented in a way that the rooms to which it connects are positioned on its local Y axis. When selecting a portal, a yellow ribbon appears around the portal to help visualize it. The yellow line represents the separation between the front and back areas. If the rooms overlap, the room with the highest priority is chosen. When working with rooms and portals in the level editor, be sure to set the viewport to Realtime so that the portal visualisations are updated correctly as you move portals.
|
Verify your Setup
- Start the scene and stay at the start location. When playing the events on the emitters inside the rooms, you should be able to hear them.
Connect to Wwise Authoring and navigate to the Game Object Profiler layout (shortcut F12). In the Game Object 3D Viewer you will see:
- a visualization of the rooms in grey (if the AkSpatialAudioVolume doesn't have Surface Reflectors enabled).
- a visualization of the portals in green.
- sound propagation paths diffracting on the edge of the portal(s) with an associated diffraction value at each edge depending on the bending angle.
- sound propagation paths going through the walls of the room with an associated transmission loss value.
| Note:
This transmission loss value can be set by changing the transmission loss parameter of the room in the AkRoomComponent component. |
- spread cones for the diffracted and transmitted paths of the sound if it has a spread curve.
| Note:
Diffraction and transmission loss attenuate the sound using the Diffraction and Transmission curves in the sound's Attenuation ShareSet. When these curves are set to Use Project Obstruction/Occlusion, they use the curves in the Obstruction/Occlusion tab of the Project Settings in the Authoring application.
|
Portals and Reverb
Sound emitting through Portals can reverberate into the room the listener is currently in. These steps show how to configure it.
- In the Wwise project,
Find the Auxiliary Bus used for the Room Reverb. The room where sound is emitted from that we want to feed to other room reverbs.
- In the General Settings of the Auxiliary Bus Property Editor, make sure use game-defined auxiliary sends is enabled.
- Generate SoundBanks, start the scene and connect to the Wwise Authoring.
Play the sound in the room with enabled auxiliary sends and navigate to a communicating room.
- You should see that the wet part of the emitting sound will also feed the reverb of the room the listener is in.
Room Tones
Sometimes, rooms have a specific ambient sound like the buzzing sound of air conditionning. To recreate this, you can post an event on the Spatial Audio Room game object. When the listener will be in the room, the sound will be positionned at its location. When in a different room, the listener will hear the room tone from the connecting portals and through the walls.
- In the Wwise project,
- Create a new Sound SFX for the room tone.
- In the General Settings tab, enable Use game-defined aux sends if you want the sound to send to reverb.
- In the Positioning tab:
- Add an attenuation for distance attenuation, diffraction, and transmission curves.
- Enable Diffraction and Transmission
- Create a play event with the room tone by right-clicking on the Sound SFX, then selecting New Event > Play.
- Save the project and generate SoundBanks.
- In Unreal,
- Drag the Event created in the previous section from the Wwise Browser to the Content Browser.
Add this event to the Ak Audio Event parameter, under the Ak Event section, of one of your rooms.
- Adjust the Aux Send Level to feed some of the sound to the reverb of the room.
- You can choose to check the Auto Post box to post the room tone event on BeginPlay, or you can call the same Blueprint functions usually used to post events on game objects.
In the Spatial Audio Tutorial map, we used Blueprint functions in the Level Blueprint to activate and deactivate the room tone.
- While having the AkSpatialAudioVolume with a room tone selected in the World Outliner, right-click in the Level Blueprint to create a reference.
- Drag a connection from the reference and search for "Post Associated Ak Event".
- In the same way, search for the Stop function.
- Add a key press as an input node.
- Start the scene and connect to Wwise Authoring.
Navigate to the room with a room tone and press the key to start the room tone. Verify that you can hear it.
- In the Advanced Profiler view, you should see the event being played.
Advanced Profiler view when playing a room tone
In the 3D Game Object Viewer, you can watch the room game object as you move the listener around.
- If the listener is in the room, the room will emit at the position of the listener. You will see the room game object follow the listener game object.
- If the listener is in a different room,
- a room game object will be placed at the portal indicating the position of the diffracted sound and a path will be drawn between it and the listener game object.
- a room game object will be placed at the limit of the room on the direct path indicating the position of the transmitted sound.
- spread cones will be drawn for both of these positions.
- See also
-