Exercise – importing a sound into the Unreal Editor

You may come across a situation where you have created your own audio effect file and want to use it in the game. We will first start by importing this file.

For this exercise, I have used an audio clip downloaded from a Wikipedia site (https://en.wikipedia.org/wiki/The_Four_Seasons_(Vivaldi)) with a Vivaldi piece from The Four Seasons. This is shared by John Harrison.

This file is in the Oggs format, and yes, Unreal only supports .wav files. First, I converted the file type from .ogg to .wav using software that's listed on the Vorbis website at http://vorbis.com/software/. Be careful about the WAV file settings that Unreal is expecting it to be in.

After getting the right wav file, we are ready to import it into the Sound Editor. Go to Content Browser | Content | Audio, right-click on it to display the contextual menu, navigate to New Asset | Import to /Game/Audio, and browse to the folder where you saved the .wav file and select it. This screenshot shows where you can find the function in the editor to import the .wav file:

Exercise – importing a sound into the Unreal Editor

This screenshot shows you how the Vivaldi WAV file is successfully imported as a sound wave in the Audio folder with the WAV file settings:

Exercise – importing a sound into the Unreal Editor

Next, create a Sound Cue for the Vivaldi sound wave that we have just imported. To recap, a Sound Cue is used to control the playback of the sound wave file. A sound wave file merely has the contents of the audio file. Right-click on the sound wave asset, as shown in this screenshot, and select Create Cue in the contextual menu:

Exercise – importing a sound into the Unreal Editor

Double-click on the newly created Sound Cue (which has a default name with the same name as the sound wave file with a Cue suffix). In the example here, it will be Vivaldi_Spring_Allegro_ByJohnHarrison_Cue. Double-click on this Cue to view the contents. The following screenshot shows the contents of Vivaldi_Spring_Allegro_ByJohnHarrison_Cue. The wave player output is connected directly to Output. This is the simplest connection for a Sound Cue where we input the wave to the Output.

Exercise – importing a sound into the Unreal Editor

Now, let's hear the sound we have imported. Within the Sound Cue Editor, look for the Play Cue button in the top-left corner of the editor. Take a look at the following screenshot for location of the button. After clicking the button, you would hear the music we have just imported. You have just successfully imported a custom wave file into Unreal. Now, let's transfer it to the game level.

Exercise – importing a sound into the Unreal Editor
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset