Bash.tv → GitHub → itch.io

Find sound effects and music for a game that the user is allowed to use, download them into the game, wire them up, and keep a CREDITS.md and in-game credits screen up to date. Searches Openverse (no key, includes Freesound and Jamendo) and optionally the Freesound API, filters to safe licenses (CC0 / CC BY by default), converts to game-friendly MP3 + OGG, and audits a build for uncredited or N...

Download skill (.zip) Files on GitHub

Game audio with credits

Rules

F=<skill>/scripts/find-audio.py
python3 $F search "coin pickup" --sfx --max 2      # short sound effects (Freesound via Openverse)
python3 $F search "calm piano loop" --music -n 8   # music (mostly Jamendo)
python3 $F search "explosion" --freesound          # Freesound API directly (needs the key, see below)

Options: --max/--min seconds, --license cc0,by,by-sa, -n results, --json.

Picking: the bot can’t listen. Pick by title, length, and creator. Short (under 1 s) for UI and pickups, 1–3 s for hits and explosions. Music should be 1–3 minutes and loop-friendly (“loop” in the title helps). When taste matters (music, the main jump sound), offer the user 2–3 options with their listen links and let them choose.

2. Download and credit

python3 $F get <id> --out www/assets/sfx/coin.mp3 --ogg       # + coin.ogg, credit line added
python3 $F get <id> --out www/assets/music/theme.mp3 --ogg     # music is re-encoded to 96 kbps automatically

3. Wire it into the game

Use Web Audio for sound effects and a looping <audio> for music, with a first-tap unlock and a mute button. If the bash-web-game-checkup skill is installed, use its references/fixes.md#audio-unlock snippet. Otherwise:

const ctx = new (window.AudioContext || window.webkitAudioContext)();
addEventListener("pointerdown", () => ctx.resume(), { passive: true });
addEventListener("keydown", () => ctx.resume());
const ext = new Audio().canPlayType("audio/ogg") ? "ogg" : "mp3";
const sfx = {};
async function load(name) {
  const buf = await (await fetch(`./assets/sfx/${name}.${ext}`)).arrayBuffer();
  sfx[name] = await ctx.decodeAudioData(buf);
}
function play(name, vol = 0.7) {
  if (muted || !sfx[name]) return;
  const s = ctx.createBufferSource(), g = ctx.createGain();
  s.buffer = sfx[name]; g.gain.value = vol; s.connect(g).connect(ctx.destination); s.start();
}

Balance volumes: music around 0.3–0.4, UI sounds around 0.5, important hits around 0.8. Save the mute setting.

4. Credits screen

Add a small Credits button or menu entry that lists each CC BY item: title, creator, and license. Read it from a short array in the game code, kept in sync with CREDITS.md.

5. Audit before publishing

python3 $F audit www

Lists audio files with no credit line (exit code 1) and any NonCommercial items. Fix both before publishing, or confirm with the user.

Freesound key (optional)

Openverse already covers most Freesound sounds without a key. For the full Freesound search, the user adds a key in Bash → gear icon → API keys → Any API: address freesound.org, sent as the Authorization header with the value Token <key>. Get the key at https://freesound.org/apiv2/apply. A 401 Authentication credentials were not provided error means the key isn’t attached. Use Openverse instead.

Other sources (no API)

OpenGameArt (music made for games), Incompetech (CC BY 4.0), and Pixabay Music: the user downloads the file and uploads it into the chat. Copy it into assets/, then add its credit line by hand with the title, creator, page URL, and license.