Randomize Ambience
If you want to create an immersive sound environment that matches your scenario, here’s a proposal to easily combine a background loop with some other sound details to add interest to your ambience.
1. Samples
A way to create an immersive sound environment without making it boring is to bring in some SFX details that randomly trigger over a loopable, base background layer that fits your game setting. For example, if your game occurs in a dark, spooky scenario, you might want to create a nocturnal scary soundscape with animals growling, creepy creatures, or strange noises in the dark.
For this purpose, you will need to find a soundscape, background audio that will be played constantly and will work as a room tone or environment ambience. A WAV audio file that is too long could take up a lot of memory space, so we recommend focusing on finding an audio that loops fine and seamlessly, even if it’s a little bit shorter.
In addition, you should look for some SFXs that will sound over your background audio. They often come in a long single audio file instead of multiple short files. You need to split that file so their individual sounds can be triggered independently. Some soundbank programs like Soundly allow you to select and download fragments of the full audio without needing to download it. Anyway, you can always split it yourself with an audio editor like Audacity and get those shorter individual fragments.
2. Waveplayers and Mixer
You’ll need two Wave Players in a single MetaSound, each one with its own logic, and a Mixer that blends them together.
Check this guide to learn how to import audio files, how to create MetaSounds, and how to make them ready for use in your game: Audio Integration
Add a Wave Player to the Graph, load your long ambience WAV, and mark the Loop checkbox. Check this if you don’t know how: 2. Creating and configuring a MetaSound
As this MetaSound will be on loop, you don’t need the Output node with the On finished pin, so you can remove it. If you hover over this node, a message will appear explaining that it is necessary for one-shot sounds. This is not the case, so you can get rid of it.

In your MetaSound Asset, the Interfaces tab will usually be displayed on the left of the window; if it’s hidden, click on Window in the toolbar on top and select Interfaces to make it visible.

Then, in the Interfaces tab, click on the trash can icon next to UE.Source.OneShot that comes by default. If you don’t remove it, your looping won’t be affected and will work correctly, but a warning message will be displayed on the Output node and the Play button.

Now, press the Play button on top, and wait for the MetaSound to make a complete cycle to check that the audio is looping correctly, with no clicks or artifacts. Remember to match the number of output nodes to the number of channels of your WAV file.

It’s recommended to add the music to a different MetaSound so they can be assigned to different sound classes and be manipulated by the volume settings sliders independently.
You will now need a second Waveplayer for your SFX, and a mixer so both Waveplayers can be listened to simultaneously and to adjust their volume independently.
Create another Waveplayer, and add your SFX samples as a variable as explained here: 2. Randomizing samples. On this page you can also find instructions on how to randomize the SFX’s pitch, if you wish.

Now, right-click on any point of the graph and look for a Mixer. There are options available that can mix up to 8 waveplayers, mono or stereo. In this case, you’re interested in a Mixer that works with two elements, so choose the Stereo Mixer (2).

If you still have connected the Out Left and Out Right pins of your first Waveplayer to the Output nodes, you need to break those links. Select the Output nodes, right-click on them, and click on Break Node Link(s).

Now, connect the Out Left and Out Right pins to the In 0 L and In 0 R pins of the Mixer, respectively. Do the same with the second Waveplayer, this time to In 1 L and In 1 R. Finally, connect the Out L and Out R pins of the Mixer to the Out Left and Out Right pins, respectively, of the Output nodes.

3. Random timing
At this point, your SFXs will be triggered just once, when the MetaSound starts to sound. To make them sound randomly throughout all the looping audio, you need to create a random trigger logic structure.
First of all, you need a Trigger Repeat node: right-click on the graph and look for it.

With this node alone, the Waveplayer will be triggered every amount of seconds you set in the Period value, but to make it random, you’ll need to add a Random (time) node by right-clicking on the graph and looking for it.

Connect the pins as follows: the On Play pin of the Input node to the Next pin of the Random (time) node; connect the On Next pin of the Random (Time) node to the Start pin of the Trigger Repeat node, and also the Value pin of the Random (Time) node to the Period pin of the Trigger Repeat node; finally, connect the Repeat Out pin of the Trigger Repeat Node to the Next pin of the Random Get node. Set the Minimum and the Maximum values, in seconds, for the node to randomly pick from.

At the moment, your SFXs will sound in a random number of seconds between the Min and the Max values you just set, but there is a possibility that a sample gets triggered before the previous one ends. For example, a sample that lasts 5 seconds could be triggered, and the next one starts sounding just 2 seconds later, as this value falls within the established range.
Maybe you don’t mind if your SFXs overlap, but if you want to prevent it, set the Minimum value in the Random (time) node to be at least equal to the longest of your samples, so there’s no possibility of the next sample being triggered before the previous one has ended.
In addition to this looping and random timing structure, you can add pitch randomization as explained here: Randomize Sounds
Finally, remember to register your MetaSound in the corresponding Data Table, as detailed here: 4. Data Table