A declarative XML format for procedural sound effects on the web.
This is a monorepo managed with pnpm workspaces containing all SPA packages:
spa/
βββ packages/
β βββ core/ # @spa/core - Core JS library (parser + renderer)
β βββ react/ # @spa/react - React component integration
βββ apps/
β βββ web/ # @spa/web - Website with visual designer
βββ docs/ # Documentation
β βββ SPEC.md # Technical specification
β βββ QUICKSTART.md # 5-minute tutorial
β βββ ROADMAP.md # Implementation roadmap
βββ examples/ # Example .spa files
β βββ ui/ # UI sounds
β βββ forms/ # Form validation
β βββ game/ # Game effects
β βββ ambient/ # Atmospheric sounds
βββ schema/ # JSON Schema for validation
- Node.js 18+
- pnpm 8+ (
npm install -g pnpm)
# Clone the repository
git clone https://github.com/yourusername/spa.git
cd spa
# Install dependencies
pnpm install
# Build all packages
pnpm build# Run all packages in dev mode
pnpm dev
# Run specific package
pnpm web:dev # Website with visual designer
pnpm core:test # Run core library testsCore JavaScript library for parsing and rendering SPA files.
- Zero dependencies - Uses native Web Audio API
- < 20KB gzipped
- TypeScript support
- Renders sounds in < 10ms
import { renderSPA, playSPA } from '@spa/core';
// Play a simple click sound
await playSPA(`
<spa version="1.0">
<tone wave="sine" freq="800" dur="0.05"
envelope="0,0.02,0,0.03"/>
</spa>
`);React component for easy SPA integration.
import { SPASound } from '@spa/react';
function Button() {
return (
<button>
Click Me
<SPASound autoPlay>
{`<spa version="1.0">
<tone wave="sine" freq="800" dur="0.05"/>
</spa>`}
</SPASound>
</button>
);
}Visual designer and documentation website.
- Visual Sound Designer - Build sounds with a GUI
- Live Playground - Write and test SPA code
- Example Library - 50+ ready-to-use sounds
- Documentation - Complete reference
Problem: Web developers need sound effects but WAV/MP3 files are huge, static, and non-parametric.
Solution: SPA - a tiny XML format that describes sounds procedurally, just like SVG describes graphics.
Example:
<spa version="1.0">
<tone wave="sine" freq="800" dur="0.05" envelope="0,0.02,0,0.03"/>
</spa>- File size: 80 bytes
- Equivalent WAV: 9.6 KB
- Savings: 120x smaller
50-100x smaller than WAV/MP3 for simple sounds
// Dynamic pitch based on user score
const freq = 400 + (score * 10);
playSPA(`<tone wave="sine" freq="${freq}" dur="0.1"/>`);Inline sounds directly in your HTML/JS
LLMs can generate SPA syntax easily
- Technical Specification - Complete format reference
- Quick Start Guide - Learn SPA in 5 minutes
- Roadmap - Development timeline
- Build Instructions - Detailed implementation guide
<!-- Button Click -->
<spa version="1.0">
<tone wave="sine" freq="800" dur="0.05"
envelope="0,0.02,0,0.03"/>
</spa>
<!-- Laser Effect -->
<spa version="1.0">
<group>
<tone wave="saw" dur="0.3"
freq.start="1200" freq.end="200" freq.curve="exp"
envelope="0,0.1,0,0.2"/>
<noise color="white" dur="0.1" amp="0.3"/>
</group>
</spa>
<!-- Success Chime -->
<spa version="1.0">
<group>
<tone wave="sine" freq="523" dur="0.15"/>
<tone wave="sine" freq="659" dur="0.3"/>
</group>
</spa>pnpm dev # Run all packages in dev mode
pnpm build # Build all packages
pnpm test # Run all tests
pnpm lint # Lint all packages
pnpm typecheck # Type check all packagespnpm --filter @spa/core test # Test core library
pnpm --filter @spa/web dev # Run website locally
pnpm --filter @spa/react build # Build React component- β Core library (parser + renderer)
- β Basic website with visual designer
- β 20+ example sounds
- β¬ npm package published
- β¬ VS Code extension
- β¬ Vue integration
- β¬ CLI tools
- β¬ 50+ example sounds
- β¬ Community sound library
- β¬ AI integration
- β¬ Browser DevTools support
- β¬ W3C proposal
Contributions are welcome! Please read our contributing guidelines (coming soon).
MIT
- Website (coming soon)
- NPM Package (coming soon)
- Discord Community (coming soon)
Let's make web audio better. π