Importing Audio
The final thing to add to your menu scene is a background audio loop. For this, find the dark piano loop part 2 file in the materials folder, or download it directly from loopazon.
Create another folder in the FileSystem called Audio. Copy the dark piano loop part 2 file into this folder and allow Godot to import it.
Just like with animations and textures, in order to modify the properties of an audio clip, the file will need to be reimported. Double-click the audio file to open the Audio Stream Importer window. Enable the Loop option, and then click Reimport to save this file.
Go back to the Warehouse scene for the final time. Right-click the root node and select Add Child Node. Search for Audio and you’ll find a few results are returned. For background music, choose the AudioStreamPlayer node. This is the option to use when you want non-positional audio, such as background music.
In the Inspector view for the AudioStreamPlayer node, select Load from the Stream drop-down, and select the dark piano loop part 2 file. Next, enable the Autoplay option a couple of lines down.
Save and play the scene. Your menu scene is now complete!
Where to Go From Here?
In this tutorial, you’ve learned:
- How to import a variety of different asset types to work with in Godot.
- About the nuances of reimporting files to make them editable.
- How to import and set up animation playback.
- About some of the core concepts of Godot such as working with Nodes and Scenes.
For a deeper look into Godot, check out our Godot Learning path.