CRI ADX(Unreal Engine) v1
Intermediate Level 15 6 Basic Voice Controls Using Blueprint

Before starting

To avoid confusion, please remove the Actors that were placed in the level in the previous tutorial, "Intermediate Level 14: Making Sounds From Moving Objects."

Playing Audio

As a review, please implement "playing the "simple_bgm" cue when you press "1" on the keyboard."
Also, uncheck "Auto Activate" for "simple_bgm."
If you have forgotten how to do this, please see "Beginner's Lesson 06: Playing a sound when the player presses a button."


Pause, resume, and stop audio

Pause/Resume

To pause or resume, use the “Pause” node in the “Atom Sound” category.
To pause, connect the nodes as shown below.
Check the "Pause" checkbox.


Create another "Pause" node.
To resume (unpause), connect the nodes as shown below.
Be careful not to check the "Pause" checkbox.

Stop

To stop the sound, use the “Stop” node in the “Atom Sound” category.
Connect the nodes as shown below.

Controlling audio with buttons

Compile the level blueprint and run the game.

  • Press "1" on the keyboard to start playing the background music.
  • Press "2" on your keyboard to pause the background music.
  • Press "3" on your keyboard to unpause the background music.
  • Press "4" on your keyboard to stop the background music.

Volume and pitch changes

Change the volume

Open the level blueprint.
Place the “Set Volume” node in the “Atom Sound” category.


Drag and drop the simple_bgm from the Outliner into the level Blueprint.


Connect simple_bgm to the target.
To change the volume, set the Volume value.
Volume can be set between 0.0 and 1.0.
This time, let's set the volume to 0.5.


Listening to the result

Compile the level blueprint and start the game.
Play background music and make sure the volume is turned down.
If you find it difficult to hear the volume change, try setting the volume to an extreme value such as 0.1.

Change pitch

Open the level blueprint.
It is better to return the volume to its original state, so delete the “Set Volume” node created earlier.
Place the “Set Pitch Multiplier” node in the “Atom Sound” category.

Just like when “changing the volume”, connect simple_bgm to the target.


“New Pitch Multiplier” sets the pitch multiplier.
If you specify 2.0 for "New Pitch Multiplier," the sound will be played at twice the pitch (one octave higher).
If you specify 0.5 for "New Pitch Multiplier," the sound will be played at half the pitch (one octave lower).
This time, let's set the pitch to 0.5x.


Listening to the result

Compile the level blueprint and start the game.
Play the background music and notice that the sound is played at half pitch.

Try raising the pitch

Let’s set the “New Pitch Multiplier” of the “Set Pitch Multiplier” node we used earlier to 2.0.
In theory, this should play the sound at twice the pitch, but if you actually play the background music, you'll see that the pitch doesn't change.

Additionally, the output log shows a large number of warnings.


You may not be able to raise the pitch with the initial settings (depending on the type of waveform data).
If you get this warning, change the settings as follows:

  • Open the menu "Edit" > "Project Settings".
  • Open the CriWare page.
  • Please change the setting values of the following two items to larger values.
    • "Sampling Rate of Standard Memory Voice"
    • "Sampling Rate of Standard Streaming Voice" The standard is 96000 to 144000 (depending on the pitch).


Please restart the UE5 editor after changing the settings.
Now you can make the pitch higher.