Playing audio in Godot
Since Godot uses nodes for almost everything, it is no different for playing sounds. To play an audio file, there are nodes you can attach to your scene, and you can configure them according to whether it’s for a 2D or 3D game. We’ll focus on different audio players Godot uses in this section.
No matter what audio file type you choose, you will be able to play it with the nodes we’ll present in this section. The experience you’ll feel will be different, of course, based on the node type, but this is something you have to decide, depending on the type of game you are making. So, let’s look at the audio streamer nodes Godot uses so that you can pick the appropriate one. Your three choices are as follows:
- AudioStreamPlayer: This node’s official definition is somewhat dry; it plays audio non-positionally. What this means is that you are not concerned with which direction the audio is coming from. For an FPS game...