CRI ADX(Unreal Engine) v1
Intermediate Level 16 Controlling the playback of categorized sounds
In this lesson, we will show you how to control playback of sounds via categories.
Once you have mastered this lesson, you will be able to do things like "stop all Cues that belong to a category called SE".
How do I set up categories?
Categories can be set in the CRI Atom Craft tool.
For more information, please see "CRI Atom Craft Beginner's Edition 09 Category Setting."
Adding new sounds
We have prepared some sound samples for you to use in this lesson.
tutorial_sample_ue4_lesson16.zip
Download the file and import the “Category_Controll.acb” and “SimpleMusic.acf” into your UE5 project.
Since we are changing the contents of the ACF file this time, please restart the UE5 editor after importing it.
Before starting
To avoid any confusion, please remove the sounds you placed in the level in the previous tutorial "Intermediate Level 15 Basic Voice Control 6 Shots with Blueprint", as well as the nodes you added to the level's Blueprint.
Pausing and resuming the sounds belonging to a category
Place "Category_Controll_VOICE_a_Cue" and "Category_Controll_VOICE_b_Cue" on the level.

Both "Category_Controll_VOICE_a_Cue" and "Category_Controll_VOICE_b_Cue" belong to the category "VOICE".
Open the level's Blueprint.
Let's try pausing all sounds in the "VOICE" category when you press "1" on the keyboard.
Add a "Pause by Name" node available in the "Atom Category".
For "Category Name", specify the name of the category you want to use to control the playback.
This time, specify "VOICE".
Check the "Pause" checkbox.

Next, let’s try unpausing the “VOICE” category when you press “2” on the keyboard.
Add another "Pause by Name" node from the "Atom Category".
Specify "VOICE" for "Category Name".
Uncheck the "Pause" checkbox.

Listening to the result
Compile the level's Blueprint and start the game.
Two dialog lines are being played.
Make sure that pressing "1" on your keyboard pauses both sounds.
Then press "2" on your keyboard to unpause the sounds.
Stopping sounds belonging to a category
Open the level's Blueprint.
Add a "Stop by Name" node from the "Atom Category.
Specify "VOICE" for "Category Name".

Compile the level's Blueprint and start the game.
Notice that pressing "3" on your keyboard stops both dialog sounds.
Setting the volume of the sounds belonging to a category
Place "Category_Controll_SE_enter18_Cue" on the level.

"Category_Controll_SE_enter18_Cue" belongs to the "SE" category.
Open the level's Blueprint.
Let's make "Category_Controll_SE_enter18_Cue" play when you press the space bar.
If you have forgotten how to do this, please see "Beginner's Lesson 06: Playing a sound when the player presses a button."

Let's change the volume of the "SE" category when "4" is pressed on the keyboard.
Add a “Set Volume by Name” node from the “Atom Category”.
Specify "SE" as the "Category Name".
"Volume" specifies the volume multiplier.
This time, let's scale the volume by 0.3.

Listening to the result
Compile the level's Blueprint and start the game.
The 2 dialog lines are being played.
Please make sure that the sound effect (ping-pong ♪) is heard when you press the space bar.
Notice that pressing "4" on your keyboard reduces the volume of the sound effects.
If you then play the sound effect several times, you will notice that the volume attenuation continues.
We can also see that commands applied to the sounds of the SE category have no effect on the sounds of the VOICE category, and vice-versa.
Tips
This time, we directly wrote the category's to demonstrate how to use it. However, in a real project, it can be a good idea to use arrays of "category name", "volume value", and "pause flag" structures.
What if there's no sound?
Please check the "Output Log".
If you get an error like the one below, delete "SimpleMusic.acf" and import it again.
