Hello,
I am just starting to learn about meta sounds but there is one thing that I can not find the answer to anywhere. How would you implement something like “branch” or “switch” nodes from Sound Cues into metasounds?
I would like to play different wave audios based on a boolean value.
![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/9/5/c95257195ce3a32a678640cddb24956192341503.png)
1 Like
I wanted to use the sounds to play engine sounds differently when inside/outside the car. It is really easy to do using sound cues but it took some effort to make in metasounds.
I do not know if this is the right way to go, but I wanted to share if someone came across this “issue” in the future.
What I ended up doing is that I’ve created a second metasound called “Audio Switcher”. You need to promote anything that you would like to use into inputs/outputs. So in my case I have 6 inputs:
- Default On Play input which triggers the “Trigger Select” node
-
Integer “Sound Index” input which defines which audio to play in “Trigger Select” node (So in my case either normal (0) or interior (1) sound)
- & 4. are Wave Asset inputs so you can later alter which wave assets to play
- (Optional) Loop input to define whether to loop the wave asset or not
- (Optional) Stop input to allow us to trigger stop to the asset being played
and for simplicity, I used just 2 outputs which need to go into “Trigger Any” node so it always passes through no matter which (exterior / interior) sound has been played.
You can use this metasound as kind of a preset in your second metasound that you will use for playing engine sounds.
You just need to drop it there from the content browser and you should have something like this:
![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/7/3/d7396162ce5a6fa15f254877665b511cd1a37e31.png)
Then you can create your logic which uses the AudioSwitch created like this (This is just a very simple implementation for demonstration purposes).
Hope this will help someone since I could not find anything related to this matter. If someone has a better way of doing it, please let me know.
3 Likes
It’s really strange. Boolean switch is the basis of computing. But if someone needs it, it’s possible to cheat with the Compare trigger :