Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Play random sound variations in Godot 4

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,…

In Godot 4, a single sound played repeatedly can sound monotonous. Recording multiple variations of the same sound helps. The AudioStreamRandomizer resource in Godot 4 lets the engine choose among these recordings when triggered. The class reference explains it wraps a collection of audio streams with pitch and volume adjustments.

Playback modes include random with no repeats, random, or sequential. No repeats prevents the same stream from playing twice in a row. Weights assign a probability to each stream, defaulting to 1.0. Random_pitch and random_volume_offset_db add variability to pitch and volume on each playthrough.

Creating a randomizer is simple in the Inspector. Simply select your AudioStreamPlayer, add an AudioStreamRandomizer to its stream property, and set the streams_count to the number of recordings. Drag each recording into the stream slots. Adjust playback mode, weights, random_pitch, and random_volume_offset_db. Save it as a .tres file for future use. While this method works for a few sounds, it becomes cumbersome with many.

An alternative is creating banks of randomizers via a script. The add_stream(index, stream, weight = 1.0) method allows streams to be inserted anywhere in the bank by using negative indices. The Resources page provides a script to save the bank. Load the desired audio files, add them to the bank, then save it. One script run from your project creates the bank. However, you still need to manage file lists or file grouping code.

For a more comprehensive solution, Cue Banks for Godot 4 is available for $8 with a free sample project. It groups multiple sound families into individual, editable randomizer resources. The tool lets you review grouping and numbering gaps, audition source clips, set weights, and choose exported banks. The exported ZIP contains native .tres files and a source path manifest.

The tool supports WAV, OGG, and MP3 formats. The free sample includes six original WAVs and three exported banks, ready to be loaded in Godot 4.7.2. Purchasing the tool provides a single solution for both individual and studio users. It was tested with Chrome on Windows. After extracting the ZIP, open the index.html file.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Working with Canadian benefit payment dates in JavaScript

If you build a budgeting app or a reminder bot for people in Canada, someone will ask: "When does my CPP come in?" It looks like a date-math problem. Mostly it isn't.

  • Canadian CPP payments dates listed on canada.ca
  • Daybook Times stores published list, not computes dates
  • CDB payment date calculated as third Thursday of month

Approved, but Locked Outside My Own House 🐝🔑

Sorry for my absence 😅 I was busy finishing something: a WordPress plugin for BeeLadybug, written in PHP. Just a small first piece, but mine. 🐞 Here's how it went.

  • WordPress plugin BeeLadybug approved by WordPress.org
  • Antonio Prosperi's account blocked after plugin submission
  • BeeLadybug inspects WordPress sites for layout issues

iPhone Face ID Not Working? 7 Fixes That Work

Face ID suddenly stops unlocking your iPhone, or it fails every time and asks for your passcode instead. This is often caused by a dirty camera, a screen protector covering the sensor, a change in…

  • Clean TrueDepth camera area with soft cloth to remove obstructions
  • Ensure Face ID is enabled in Settings Face ID & Passcode
  • Update iOS to latest version for potential Face ID fixes

Amazon Interview Question: Count the Votes. Now Let Everyone Change Their Mind.

One voter, two browser tabs, and the follow ups that turn a simple counter into a system design problem. Maya votes for A, changes her mind, and votes for B. Her connection drops, so her phone sends…

  • Design a live poll system for millions of concurrent voters.
  • Implement versioned records for each voter's choice to handle changes.
  • Use transactional datastores and stable request IDs to manage updates.

More from Tuesday, 1 December 2026 →