home/ atoms/ p5-sound-library-web-audio

p5.sound wraps the Web Audio API in a Processing-style interface for audio analysis and playback

p5.sound.js is an addon library for p5.js that exposes the browser’s Web Audio API through a Processing-idiomatic JavaScript interface. It provides ready-made objects for loading and playing sound files (p5.SoundFile), measuring amplitude (p5.Amplitude), frequency analysis (p5.FFT), microphone input (p5.AudioIn), and peak/beat detection (p5.PeakDetect). This abstraction reduces the boilerplate of working with AudioContext, AnalyserNode, and ScriptProcessorNode directly, making audio-reactive browser sketches accessible to creative coders without a DSP background.

Examples

new p5.SoundFile(‘track.mp3’); new p5.Amplitude(); new p5.FFT(smoothing, binCount) — all operate within the p5.js setup()/draw() loop.

Assessment

Name four p5.sound classes and the DSP operation each provides; explain what the Web Audio API is and why wrapping it simplifies audio-reactive sketches.

“**p5.sound.js** is an addon library that brings the Processing approach to the [Web Audio API](http://w3.org/TR/webaudio/).”
corpus · visualizing-music-with-p5-js-jason-sigal-audio-reactive-work · chunk 1