Scenario
Imagine a weapon that has two elements:
- An individual fire sound for every shot fired (several a second), and
- A barrel “spin up”, “spin loop”, and “spin down” sound.
Triggering the fire sound is relatively easy but the attack, loop, and release phase of the barrel spin could seams more complex.
Here’s a suggestion of how you can manage this behavior using Wwise:
To clarify the scenario:
- The barrel spin up (attack phase) plays when the trigger is pulled.
- If the trigger is released, the spin down (release phase) plays.
- If the trigger is held, the fire sound starts and the barrel spin loop plays for as long as the trigger is held.
- The spin down always plays whenever the trigger is released.
Solution A
A good way to handle the barrel effect is by using an audio file with a looping region, and break it. Here are the repro steps (for the barrel mechanism only, not the fire sound):
- Create 1 Sounds (“Spin”), in which there is a looping region around the sustained spin loop.
- Set “Spin” to Loop/Infinite
- Create an Event and name it “Play_Attack”. There is one action in that event: Play - "Spin".
- Create another Event and name it “Play_Release”. There is one action in that event: Break - "Spin"
When the Break action occurs, the sound will play until the end and stop.
Solution B
Another way to handle the barrel effect is by creating a sequence container and two events. Here are the repro steps (for the barrel mechanism only, not the fire sound):
- Create 3 Sounds (“Spin up”, “Spin loop” and “Spin down”).
- Set “Spin loop” to Loop/Infinite
- Create a Sequence Container (name it “Attack”) and set it this way:
- Play type: Sequence
- Play mode: Continuous
- Transition: Sample accurate
- Insert “Spin up” and “Spin loop” in the Sequence Container.
- Create the sequence in the Content Editor view: start with “Spin up” and then “Spin loop”.
- Note that in order to get a sample accurate Sequence, your two sounds should have the same format (i.e. # of channel, sample rate, etc.)
- Create an Event and name it “Play_Attack”. There is one action in that event:
- Play - “Attack”
- Create another Event and name it “Play_Release”. There are two actions in that event:
- Play – “Spin down” (try a fade in of 0.1s)
- Stop – “Attack” (try a fade out of 0.1s)
Solution C
And yet another way to handle the barrel effect is by using the sequence container described in solution B above, replace the "Spin Loop" sound by a random or sequence container that loops indefinitely. You can use one or many variations of the same sound, with randomizers if you like. Then, use a Break action in the Release event. Here are the repro steps (for the barrel mechanism only, not the fire sound):
- Create 4 Sounds (“Spin up”, “Spin loop 1”, “Spin loop 2” and “Spin down”).
- Create a Random Container (name it “Spin loop”) and set it this way:
- Play type: Random
- Play mode: Continuous
- Loop: Infinite
- Transition: Sample accurate
- Create a Sequence Container (name it “Barrel”) and set it this way:
- Play type: Sequence
- Play mode: Continuous
- Transition: Sample accurate
- Insert “Spin up” and “Spin down” Sounds and the "Spin loop" Random Container in the Sequence Container.
- Create the sequence in the Content Editor view: start with “Spin up”, then “Spin loop”, and then "Spin down".
- Note that in order to get a sample accurate Sequence, your two sounds should have the same format (i.e. # of channel, sample rate, etc.)
- Create an Event and name it “Play_Barrel”. There is one action in that event:
- Play - “Barrel”
- Create another Event and name it “Release_Barrel”. There is one action in that event:
- Break – “Spin loop” (notice that it applies to the infinite looping "Spin loop" Random Container)