@spa-audio/types
v1.1.3
Published
Shared TypeScript types for SPA (Synthetic Parametric Audio)
Downloads
3
Maintainers
Readme
@spa-audio/types
Shared TypeScript type definitions for SPA (Synthetic Parametric Audio).
Installation
npm install @spa-audio/typesUsage
import type {
SPADocument,
ToneElement,
NoiseElement,
ADSREnvelope
} from '@spa-audio/types';
// Use the types
const tone: ToneElement = {
type: 'tone',
wave: 'sine',
freq: 440,
dur: 1.0,
envelope: {
attack: 0.01,
decay: 0.2,
sustain: 0.3,
release: 0.5
}
};Available Types
Core Document Types
SPADocument- Root document structureSPADefinitions- Reusable definitionsSPASound- Union type of all sound elements
Element Types
ToneElement- Oscillator/tone configurationNoiseElement- Noise generator configurationGroupElement- Sound layering configuration
Parameter Types
ADSREnvelope- Attack/Decay/Sustain/Release envelopeAutomationCurve- Parameter automation over timeFilterConfig- Filter configurationWaveformType- Valid waveform typesNoiseColor- Valid noise colorsFilterType- Valid filter types
Utility Types
RenderOptions- Audio rendering optionsParseOptions- XML parsing optionsValidationError- Validation error structure
License
MIT
