The short answer
Use one AudioStreamPlayer for a UI or world sound, assign the exported WAV or OGG in the Inspector, and call play when the gameplay event occurs. Start with short, dry sounds and test them at the volume and repetition rate of the real scene.
A reliable way to start
- Generate one eventAsk for one readable action, such as a button confirmation or a boot step on wet stone. Compare variations before exporting.
- Import the fileDrag the WAV or OGG export into your Godot project. Select it in the FileSystem dock and check the import options before using it.
- Play it from the eventAdd an AudioStreamPlayer node, assign the stream in the Inspector, then trigger it from the button, player or gameplay object that owns the event.
Prompt examples
Use these as a starting point, then change the source, action, timing and perspective to fit your scene.
short Godot game UI confirmation, warm rounded click with a tiny bright tone, dry and compact, immediate clean stop
one leather boot step on damp stone, close game foley, small water squeeze and grit, short controlled decay
inventory item collected, crisp mechanical click followed by a soft upward digital chime, compact game feedback
quiet stone dungeon ambience with distant water drips and low air movement, no foreground actions, seamless loop
What makes the result more useful
- Keep UI feedback in its own small sound family so confirmations and failures are easy to distinguish.
- Use OGG when file size matters and WAV when you need a lossless source asset.
- For repeatable effects such as footsteps, create a small variation set and choose one at random.
Add the sound to your game
Play an imported sound from a node
Attach this script to the node that owns the event. Assign the AudioStreamPlayer in the Inspector so the scene remains editable.
extends Node
@export var confirm_sound: AudioStreamPlayer
func confirm_selection() -> void:
confirm_sound.play()Vary repeated footsteps
Create several AudioStream resources and assign them in the Inspector. This avoids the same sample playing on every step.
@export var footstep_player: AudioStreamPlayer
@export var footsteps: Array[AudioStream]
func play_footstep() -> void:
footstep_player.stream = footsteps.pick_random()
footstep_player.play()Frequently asked questions
Should I export WAV or OGG for Godot?
Both work. Keep WAV as a high-quality source when useful; choose OGG for smaller distributable assets where its quality is appropriate for the sound.
Where should an AudioStreamPlayer live?
Put it with the UI, character or scene that owns the sound. This makes the relationship visible in the Godot scene tree and easy to edit later.
How do I stop footsteps sounding repetitive?
Use several close variations per surface, play them in random order, and keep their levels consistent.
