blecsd-audio
Installation
SKILL.md
@blecsd/audio Package Skill
The @blecsd/audio package provides audio management for blECSd terminal applications. It uses an adapter pattern where blECSd manages state and the user provides the actual audio playback implementation. All blECSd functional programming rules apply.
Install: pnpm add @blecsd/audio
Peer dependency: blecsd >= 0.7.0
Import: import { createAudioManager, AudioChannel } from '@blecsd/audio'
Core Concepts
- AudioManager - Manages state (volume, mute, active sounds) without playing audio directly
- AudioAdapter - User-provided interface that does the actual audio playback
- AudioChannel - Two channels:
Music(0) andSFX(1), each with independent volume/mute - SoundTrigger - Event-based sound triggers that automatically play sounds on events
Quick Start
import { createAudioManager, AudioChannel } from '@blecsd/audio';