The same footstep, hit or coin sound playing over and over starts to sound mechanical. You recorded several takes. Here is how to make Godot 4 pick between them.
How Godot does it
Godot 4 has a built-in resource for this, AudioStreamRandomizer. Its class reference says it "Wraps a pool of audio streams with pitch and volume shifting."
- Playback modes: random with no repeats (the default), random, or sequential. No repeats will "avoid playing the same stream twice in a row whenever possible."
- Weights: each stream has a probability weight, 1.0 by default.
- Pitch and volume: random_pitch and random_volume_offset_db add variation on every play.
Setting up one randomizer is easy. The work grows when you have dozens of sound families.
Fix 1, free: build it in the Inspector
- Select your AudioStreamPlayer. Its stream property holds "The AudioStream resource to be played." Create a new AudioStreamRandomizer there.
- Set streams_count to the number of takes and drag one file into each stream slot.
- Set the playback mode, weights, random_pitch and random_volume_offset_db.
- Save it as a .tres file to reuse it. The Resources page of the manual says to "click the save icon at the top of the Inspector, and select "Save" or "Save As..."".
Fine for a few sounds. Slow for many.
Fix 2, free: build banks with a script
The class reference lists add_stream(index, stream, weight = 1.0), and says that if the index is less than zero, "the insertion occurs at the end". The Resources page shows ResourceSaver.save(my_res, "res://my_res.tres").
var bank := AudioStreamRandomizer.new() for path in ["res://sfx/step_01.wav", "res://sfx/step_02.wav", "res://sfx/step_03.wav"]: bank.add_stream(-1, load(path)) ResourceSaver.save(bank, "res://sfx/step_bank.tres") Run it once from a script in your project. You still need to write the file lists, or code that groups your files into families.
Fix 3, paid: group a whole folder of takes at once
I make Cue Banks for Godot 4 ($8, with a free sample project). It turns several families of audio takes into separate, editable Godot 4 randomizer resources. You review the grouping and numbering gaps, audition the source clips, set weights and choose which banks to export. The ZIP it exports contains native .tres files and a source path manifest. The free sample is a Godot project with six original WAVs and three exported banks, loaded and checked in Godot 4.7.2. One purchase covers an individual or a studio.
It supports WAV, OGG and MP3. Your original files must stay at the matching res:// paths, or the banks will not find them. It was tested in desktop Chrome on Windows. You extract the ZIP and open index.html.
Which one to use
- A handful of sounds: Fix 1.
- You already script your import pipeline: Fix 2.
- A sound pack with many families of numbered takes: Fix 3 does the grouping and lets you check it.
Written by the maker of Cue Banks for Godot 4. The tool was built with an AI coding assistant. Godot Engine is the work of its contributors; this site is not affiliated with the Godot project. This guide was written with AI help. It was first published at bhoz4-tools.pages.dev.