stewbeet.plugins.resource_pack.sounds

The sounds plugin automatically processes sound files and generates the sounds.json configuration for Minecraft resource packs.
It groups numbered sound variants.
(This plugin requires the sounds.folder configuration to be set in meta.stewbeet)

Features Showcase

Example of a sounds folder with .ogg files:

Files are copied to resource pack and sounds.json is created:

Source Code: stewbeet/plugins/resource_pack/sounds/__init__.py

Source Code: stewbeet/core/utils/sounds.py

What it does

  • Processes sound files from a designated sounds folder
  • Groups numbered sound variants (e.g., sound_01.ogg, sound_02.ogg)
  • Generates sounds.json configuration automatically
  • Creates appropriate subtitles for sound identification

Dependencies

  • βœ… Required: sounds.folder configuration in meta.stewbeet
  • πŸ“ Position: Should be able to run anywhere in the pipeline
    (see basic/beet.yml for an example)
  • πŸ“‚ Assets: Requires a sounds folder with audio files

Configuration

Basic Example Configuration

yaml
pipeline:
  - ...
  - stewbeet.plugins.resource_pack.sounds
  - ...

meta:
  stewbeet:
    sounds:
      folder: "assets/sounds"             # Path to sounds directory
      exclude_patterns: ["some_folder/*"] # Optional: glob patterns to exclude

⚠️ Deprecated: The old meta.stewbeet.sounds_folder key is still supported but will emit a warning. Migrate to meta.stewbeet.sounds.folder.

Configuration Options

OptionTypeDefaultDescription
sounds.folderstringRequiredPath to the directory containing sound files. Set in meta.stewbeet.sounds.folder
sounds.exclude_patternslist[string][]Glob patterns (relative to the sounds folder) of files to exclude from processing. E.g. ["some_folder/*", "debug_*.ogg"]

Features

Sound File Processing

  • πŸ“ Recursively scans the sounds folder for audio files
  • βœ… Only supports .ogg file format for now
  • 🚫 Supports glob-based exclusion via exclude_patterns
  • 🧹 Sanitizes filenames (removes spaces, converts to lowercase)
  • πŸ“ Creates Sound objects with proper source paths and subtitles

Numbered Variant Grouping

Automatically groups sound variants with numbered suffixes:

  • dirt_bullet_impact_01.ogg 🎯
  • dirt_bullet_impact_02.ogg 🎯
  • dirt_bullet_impact_03.ogg 🎯

These become variants of the sound dirt_bullet_impact in sounds.json.

Supported numbering patterns:

  • name_01, name_02, etc. (with underscore)
  • name1, name2, etc. (without underscore)

Sounds.json Generation

  • πŸ”§ Automatically creates or updates sounds.json thanks to the add_sound function in stewbeet.core.utils.sounds
  • 🏷️ Generates subtitles based on sound names
  • πŸŽ›οΈ Preserves sound properties (volume, pitch, weight, etc.)
  • πŸ“ Uses project namespace for sound references

Next steps