audio-system

audio-system is a skill for Claude Code from bullish0x/GameStudio. It costs 23 tokens per session (4,923 once invoked), scanned A, original, MIT.

A browser-based audio system for games, covering sound effects, music, positioned 3D sound, loading, mixing, and playback limits.

In plain words
What is it for?
Use it to add sound effects, background music, spatial audio, action feedback, audio loading, and separate master, music, and effects volume controls.
Why use it?
It provides a structured way to manage game audio instead of handling every sound and volume setting separately.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: installed under .agents/ (shared by several agents).

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { AudioSource } from '../components/AudioSource';.

Good fit Use it to add sound effects, background music, spatial audio, action feedback, audio loading, and separate master, music, and effects volume controls.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/bullish0x/GameStudio
agentmods
npx agentmods add skills/bullish0x/gamestudio/audio-system

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for audio-system

README.md
[![agentmods](https://agentmods.dev/badge/skills/bullish0x/gamestudio/audio-system.svg)](https://agentmods.dev/skills/bullish0x/gamestudio/audio-system)
Your own site
<a href="https://agentmods.dev/skills/bullish0x/gamestudio/audio-system"><img src="https://agentmods.dev/badge/skills/bullish0x/gamestudio/audio-system.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,923 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.04923
Opus 5 $0.00012 $0.02462
Sonnet 5 $0.00005 $0.00985
Haiku 4.5 $0.00002 $0.00492

Measured 4d ago against content hash 036f30f26e33, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

audio-system scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const response = await fetch(url);
.agents/skills/audio-system/SKILL.md · 750 lines

How it starts

The opening of the file, as written. The whole thing — 750 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Audio System

When to Use

Use this skill when:

  • Playing sound effects
  • Managing background music
  • Implementing spatial 3D audio
  • Creating audio feedback for actions
  • Building audio mixing system
  • Handling audio asset loading

Core Principles

  1. Web Audio API: Use modern audio capabilities
  2. Spatial Audio: 3D positioned sounds
  3. Audio Pooling: Reuse audio sources
  4. Volume Control: Master, music, and SFX volumes
  5. Performance-Aware: Limit concurrent sounds
  6. Mobile-Friendly: Handle autoplay restrictions

Audio System Implementation

1. Audio Manager

// audio/AudioManager.ts
export interface AudioConfig {
  masterVolume?: number;
  musicVolume?: number;
  sfxVolume?: number;
  maxConcurrentSounds?: number;
}

export class AudioManager {
  private context: AudioContext;
  private masterGain: GainNode;
  private musicGain: GainNode;
  private sfxGain: GainNode;
  private sounds = new Map<string, AudioBuffer>();
  private activeSounds: AudioBufferSourceNode[] = [];
  private maxConcurrentSounds: number;
  private listener: AudioListener | null = null;

  constructor(config: AudioConfig = {}) {
    this.context = new AudioContext();

    // Create gain nodes
    this.masterGain = this.context.createGain();
    this.musicGain = this.context.createGain();
    this.sfxGain = this.context.createGain();

    // Connect gain hierarchy
    this.musicGain.connect(this.masterGain);
    this.sfxGain.connect(this.masterGain);
    this.masterGain.connect(this.context.destination);

    // Set volumes
    this.masterGain.gain.value = config.masterVolume ?? 1;
    this.musicGain.gain.value = config.musicVolume ?? 0.7;
    this.sfxGain.gain.value = config.sfxVolume ?? 1;

    this.maxConcurrentSounds = config.maxConcurrentSounds ?? 32;
  }

  async loadSound(name: string, url: string): Promise<void> {
    try {
      const response = await fetch(url);
      const arrayBuffer = await response.arrayBuffer();
      const audioBuffer = await this.context.decodeAudioData(arrayBuffer);
      this.sounds.set(name, audioBuffer);
    } catch (error) {
      console.error(`Failed to load sound: ${name}`, error);
    }
  }

  async loadSounds(sounds: Record<string, string>): Promise<void> {
    const promises = Object.entries(sounds).map(([name, url]) =>
      this.loadSound(name, url)
    );
    await Promise.all(promises);
  }

  playSound(
    name: string,
    options: {
      volume?: number;
      loop?: boolean;
      playbackRate?: number;
      destination?: GainNode;
    } = {}
  ): AudioBufferSourceNode | null {
    const buffer = this.sounds.get(name);
    if (!buffer) {
      console.warn(`Sound not found: ${name}`);
      return null;
    }

    // Limit concurrent sounds
    if (this.activeSounds.length >= this.maxConcurrentSounds) {
      this.stopOldestSound();
    }

    // Resume audio context (required after user interaction)
    if (this.context.state === 'suspended') {
      this.context.resume();
    }

    // Create source
    const source = this.context.createBufferSource();
    source.buffer = buffer;
    source.loop = options.loop ?? false;
    source.playbackRate.value = options.playbackRate ?? 1;

    // Create gain node for individual sound volume
    const gainNode = this.context.createGain();
    gainNode.gain.value = options.volume ?? 1;

    // Connect to destination (music or sfx)
    source.connect(gainNode);
    gainNode.connect(options.destination ?? this.sfxGain);

    // Track active sound
    this.activeSounds.push(source);

    source.onended = () => {
      const index = this.activeSounds.indexOf(source);
      if (index !== -1) {
        this.activeSounds.splice(index, 1);
      }
    };

    source.start(0);

    return source;
  }

  playSoundAt(
    name: string,
    position: Vector3,
    options: {
      volume?: number;
      loop?: boolean;
      refDistance?: number;
      maxDistance?: number;
      rolloffFactor?: number;
    } = {}
  ): AudioBufferSourceNode | null {
    const buffer = this.sounds.get(name);
    if (!buffer) {
      console.warn(`Sound not found: ${name}`);
      return null;
    }

    if (this.activeSounds.length >= this.maxConcurrentSounds) {
      this.stopOldestSound();
    }

    if (this.context.state === 'suspended') {
      this.context.resume();
    }

    // Create source
    const source = this.context.createBufferSource();
    source.buffer = buffer;
    source.loop = options.loop ?? false;

    // Create panner for 3D positioning
    const panner = this.context.createPanner();
    panner.panningModel = 'HRTF';
    panner.distanceModel = 'inverse';
    panner.refDistance = options.refDistance ?? 1;
    panner.maxDistance = options.maxDistance ?? 10000;
    panner.rolloffFactor = options.rolloffFactor ?? 1;
    panner.coneInnerAngle = 360;
    panner.coneOuterAngle = 0;
    panner.coneOuterGain = 0;

    // Set position
    panner.positionX.value = position.x;
    panner.positionY.value = position.y;
    panner.positionZ.value = position.z;

    // Create gain node
    const gainNode = this.context.createGain();
    gainNode.gain.value = options.volume ?? 1;

    // Connect: source -> panner -> gain -> destination
    source.connect(panner);
    panner.connect(gainNode);
    gainNode.connect(this.sfxGain);

    this.activeSounds.push(source);

    source.onended = () => {
      const index = this.activeSounds.indexOf(source);
      if (index !== -1) {
        this.activeSounds.splice(index, 1);
      }
    };

    source.start(0);

    return source;
  }

  stopSound(source: AudioBufferSourceNode): void {
    try {
      source.stop();
    } catch (error) {
      // Already stopped
    }
  }

  stopAllSounds(): void {
    for (const source of this.activeSounds) {
      this.stopSound(source);
    }
    this.activeSounds = [];
  }

  private stopOldestSound(): void {
    if (this.activeSounds.length > 0) {
      const oldest = this.activeSounds.shift()!;
      this.stopSound(oldest);
    }
  }

  setMasterVolume(volume: number): void {
    this.masterGain.gain.value = Math.max(0, Math.min(1, volume));
  }

  setMusicVolume(volume: number): void {
    this.musicGain.gain.value = Math.max(0, Math.min(1, volume));
  }

  setSFXVolume(volume: number): void {
    this.sfxGain.gain.value = Math.max(0, Math.min(1, volume));
  }

  getMasterVolume(): number {
    return this.masterGain.gain.value;
  }

  getMusicVolume(): number {
    return this.musicGain.gain.value;
  }

  getSFXVolume(): number {
    return this.sfxGain.gain.value;
  }

  setListener(position: Vector3, forward: Vector3, up: Vector3): void {
    if (!this.context.listener) return;

    this.context.listener.positionX.value = position.x;
    this.context.listener.positionY.value = position.y;
    this.context.listener.positionZ.value = position.z;

    this.context.listener.forwardX.value = forward.x;
    this.context.listener.forwardY.value = forward.y;
    this.context.listener.forwardZ.value = forward.z;

    this.context.listener.upX.value = up.x;
    this.context.listener.upY.value = up.y;
    this.context.listener.upZ.value = up.z;
  }

  dispose(): void {
    this.stopAllSounds();
    this.context.close();
  }
}

Read the full file on GitHub · 750 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 750 lines · 23 tokens per session scan A 036f30f26e33

Subscribe to this mod's changes

audio-system is a skill published in the GitHub repository bullish0x/GameStudio (10 stars, last pushed 2mo ago), licensed MIT. It adds 23 tokens to every session and 4,923 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

accessibility-a11y

WCAG 2.2 compliance, ARIA patterns, keyboard navigation, screen readers, automated testing.

travisjneuman/.claude · 26 tokens

flutter-development

Cross-platform development with Flutter and Dart for iOS, Android, Web, Desktop, and embedded. Use when building Flutter apps, implementing Material/Cupertino design, or optimizing Dart code.

travisjneuman/.claude · 41 tokens

game-development

Game development with Unity, Unreal Engine, and Godot. Use when building games, implementing game mechanics, physics, AI, or working with game engines.

travisjneuman/.claude · 34 tokens

electron-desktop

Desktop application development with Electron for Windows, macOS, and Linux. Use when building cross-platform desktop apps, implementing native OS features, or packaging web apps for desktop.

travisjneuman/.claude · 38 tokens

generic-react-ux-designer

Professional UI/UX design expertise for React applications. Covers design thinking, user psychology (Hick's/Fitts's/Jakob's Law), visual hierarchy, interaction patterns, accessibility, performance-driven design, and design critique. Use when designing features, improving UX, solving user problems, or conducting design…

travisjneuman/.claude · 69 tokens

frontend-enhancer

This skill should be used when enhancing the visual design and aesthetics of web applications. It provides modern UI components, design patterns, color palettes, animations, and layout templates. REQUIRES ui-research skill first. Use this skill for tasks like improving styling, creating responsive designs…

travisjneuman/.claude · 79 tokens