Location>code7788 >text

Thoughts on sound control in games

Popularity:265 ℃/2024-07-23 15:37:45

I've searched the web for sound control before, but the searches were all over the place, from pre-processing the sound to using strange functions.

After thinking about it for a while I found all the actors and then found the RootComponent to enumerate the SoundComponent and then control it. Of course, be careful in the production, because I enumerate the root under the child, so the sound component must be placed under the Root, not root under the child of the child, that is, the grandchild level.

 

And thinking about a new approach today:

The advantage of registering each SoundComponent and then managing it is that sounds played in other ways can also be registered and then discerned for control.

When registering, you need to fill in the category, such as background music, game sound effects, character voice, etc., and then manage the category to distinguish its grouping, you can control it separately, and then complete the effect on the interface: