Verify osu Skin Hitsound Sample Sets Using Python

Verify osu Skin Hitsound Sample Sets Using Python EduTechBuddy.com © edutechbuddy.com
Verify osu Skin Hitsound Sample Sets Using Python © edutechbuddy.com
Learn how to use a Python script to quickly identify missing hitsound sample files in your osu skin folder and prevent unwanted audio fallbacks during gameplay.

Customizing an osu! skin means swapping out the default hitsound samples for your own audio files. If even one required file is missing, the game switches back to its default sounds during a combo, which can break the experience you intended. For creators and editors, checking that every needed hitsound sits in the skin folder is a key step before sharing or uploading a skin.

Understanding osu! Hitsound Sample Sets

osu! uses three main sample sets for hitsounds: normal, soft, and drum. Each set covers four core sounds: hitnormal, hitwhistle, hitfinish, and hitclap. A complete skin folder should have twelve distinct hitsound files, each named with the pattern set-hitname (such as soft-hitclap.wav or drum-hitfinish.ogg). Supported file extensions are .wav, .mp3, and .ogg. Missing any of these files prompts osu! to use the default sample for that sound, which can disrupt your skin's audio consistency. The way these sample sets are structured and how fallback works matters for keeping a uniform user experience, especially when sharing skins with the osu! community.

Python Script for Checking Hitsound Files

To help skin creators check their folders, the following Python script looks for all twelve expected hitsound files. It scans the chosen directory for each required filename with any supported extension, then reports which files it finds and which are missing. The script doesn't check audio quality or content, just whether the files exist. This makes it handy for quickly auditing a skin folder before distribution or for use in educational settings focused on digital skills and file management.

#!/usr/bin/env python3
"""Report missing normal/soft/drum hitnormal, hitwhistle, hitfinish, and hitclap files."""
import sys
from pathlib import Path

SETS = ("normal", "soft", "drum")
HITS = ("hitnormal", "hitwhistle", "hitfinish", "hitclap")
EXTS = (".wav", ".mp3", ".ogg")

def present(folder: Path, stem: str) -> str | None:
    for ext in EXTS:
        if (folder / (stem + ext)).is_file():
            return stem + ext
    for p in folder.glob(stem + ext):
        if p.is_file():
            return p.name
    wanted = {stem + ext for ext in EXTS}
    for p in folder.iterdir():
        if p.is_file() and p.name.lower() in wanted:
            return p.name
    return None

def main() -> int:
    if len(sys.argv) != 2:
        print("usage: check_hitsound_sets.py /path/to/skin-folder", file=sys.stderr)
        return 2
    root = Path(sys.argv[1])
    if not root.is_dir():
        print("not a folder: " + str(root), file=sys.stderr)
        return 2
    missing = []
    found = []
    for sample in SETS:
        for hit in HITS:
            stem = f"{sample}-{hit}"
            name = present(root, stem)
            if name:
                found.append(name)
                print(" ok " + name)
            else:
                missing.append(stem)
                print(" MISSING " + stem + " (.wav / .mp3 / .ogg)")
    print("found %d of %d expected sample-set hitsounds in %s" % (len(found), len(SETS) * len(HITS), root))
    if missing:
        print("missing: " + ", ".join(missing))
        return 1
    return 0

if __name__ == "__main__":
    raise SystemExit(main())

How to Use the Script

Save the script as check_hitsound_sets.py and run it from the command line, passing the path to your skin folder as an argument. For example:

python3 check_hitsound_sets.py /path/to/skin-folder

The script prints a list of found and missing hitsound files. If you leave out certain sets on purpose (such as only including soft-* files), the script still reports the others as missing. This helps catch accidental omissions, especially if you meant to include a specific set. After adding any missing files, run the script again to check that your folder is complete.

Practical Tips for osu! Skin Creators

While the script checks that all required filenames are present, it doesn't review the audio content or how the samples sound in-game. After confirming the files, test your skin by playing beatmaps that switch between sample sets to check for consistent loudness and timing. The LayeredHitSounds setting in skin.ini also changes how hitsounds are layered during gameplay. For more on visualizing and checking osu! skin assets, see this related guide.

Checking your hitsound files before packaging your skin helps avoid surprises for players and makes sure your custom audio is used as planned. This process also builds digital literacy and file management skills, which matter in creative and educational technology work.

Camila Ferreira Editor EduTechBuddy.com
Co-Founder

Camila Ferreira

Camila Ferreira is the Co-Founder of EduTechBuddy, where her editorial focus is programming education and practical software development skills. Her primary subjects include Python programming, Git version control, and the fundamental concepts beginners need to understand when working with code.