Scenario
Let's say you have a random container with three sounds (“Hit1”, “Hit2” and “Hit3”), but in some cases, you want nothing to be played instead of one of the sounds. In this case, you can create a "silence source" within your container and use the Weight property to determine the probability the silence will be played in relation to the other sounds.
Solution
Here’s how you can add a Silence source to a random container in Wwise:
- Create a random container and insert the “Hit1”, “Hit2” and “Hit3” sound objects.
- Add a new child Sound SFX to the Random container by doing the following:
- Right-click on the container in the Project Explorer, and select New Child > Sound SFX. A new sound object is added to the Project explorer.
- Name the new sound object Silence. Note that the name is displayed in red because there is no source associated with the sound object.
- In the Project Explorer, double-click the “Silence” sound object.
- In the Contents Editor, click the Add Source >> button in the top-right corner of the view.
- From the source menu, select Silence. Note that the name of the sound object in the Project Explorer changes to white because it is now associated with a source.
- Double-click the random container to display its contents in the Contents Editor.
- Set the Weight for each of the sounds to define the probability that each sound or silence will be played.