Sound assistance

Godot Version

4.6.2

Question

I am struggling with the prospect of adding sounds to a game for the first time. I feel like there must be a more efficient way to do this than simply adding a separate audio node for each sound. Is anyone able to guide me through this?

(Specifying the position the sound plays from is unnecessary)

You can simply swap out the stream of any given AudioStreamPlayer dynamically during runtime. Or if you need random sounds, you can use the AudioStreamRandomizer as well.

This is true, but doesn’t seem to allow for playing multiple sounds in quick succession/at the same time. Any advice there?

See:

It lets you play multiple different sounds at the same time, with only one audio player.

If you’re playing only one sound multiple times, then there’s the more simple max_polyphony property on AudioStreamPlayer:

If you’re doing this for performance I would be wary of premature optimization though:

Nodes in Godot aren’t inherently very expensive, unless you have like a hundred thousand of them.