JSPM

@strata-game-library/audio-synth

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 18
  • Score
    100M100P100Q73567F
  • License MIT

Procedural audio synthesis for Strata 3D using Tone.js - SFX, music, and ambient sound generation

Package Exports

  • @strata-game-library/audio-synth
  • @strata-game-library/audio-synth/components
  • @strata-game-library/audio-synth/core
  • @strata-game-library/audio-synth/presets

Readme

@strata-game-library/audio-synth

npm version License: MIT

Procedural audio synthesis for Strata 3D using Tone.js - SFX, music, and ambient sound generation without external audio files.

📚 Documentation

Full documentation is available at strata.game/audio-synth


🏢 Enterprise Context

Strata is the Games & Procedural division of the jbcom enterprise. This package is part of a coherent suite of specialized tools, sharing a unified design system.

Features

  • Procedural Audio - Generate sounds at runtime, no external files needed
  • SFX Synthesis - Gunshots, explosions, impacts, pickups, and more
  • Procedural Music - Pattern-based music generation for menus and gameplay
  • Ambient Soundscapes - Environmental audio (wind, rain, water)
  • React Integration - Hooks and context for easy React/R3F integration
  • Presets - Ready-to-use sound effect and music presets

Installation

```bash npm install @strata-game-library/audio-synth tone

or

pnpm add @strata-game-library/audio-synth tone ```

Usage

React Context Provider

```tsx import { AudioSynthProvider, useAudioSynth } from '@strata-game-library/audio-synth';

function App() { return ( ); }

function Game() { const { playSFX, playMusic, isReady } = useAudioSynth();

const handleShoot = () => { playSFX('gunshot'); };

return ; } ```

Core API (Non-React)

```typescript import { createSynthManager, SFXPresets } from '@strata-game-library/audio-synth/core';

const manager = createSynthManager(); await manager.init();

manager.playSFX(SFXPresets.GUNSHOT); manager.playMusic('combat'); ```

Custom Sound Synthesis

```typescript import { createCustomSFX } from '@strata-game-library/audio-synth/core';

const laserSound = createCustomSFX({ oscillator: { type: 'sawtooth' }, envelope: { attack: 0.001, decay: 0.1, sustain: 0, release: 0.1 }, frequency: { start: 880, end: 220, curve: 'exponential' }, });

laserSound.trigger(); ```

Available Presets

Category Presets
Combat gunshot, explosion, impact, ricochet
UI pickup, select, confirm, error
Environment splash, footstep, wind, rain
Music menuTheme, combatTheme, ambientTheme

License

MIT © Strata Game Library Contributors