Returns an array of amplitude peaks in a p5.SoundFile that can be used to draw a static waveform. Scans through the p5.SoundFile's audio buffer to find the greatest amplitudes. Accepts one parameter, 'length', which determines size of the array. Larger arrays result in more precise waveform visualizations.
Inspired by Wavesurfer.js.
Syntax
getPeaks([length])
Parameters
length
Number:
length is the size of the returned array. Larger length results in more precision. Defaults to 5*width of the browser window.
Returns
Float32Array: Array of peaks.
This page is generated from the comments in lib/addons/p5.sound.js . Please feel free to edit it and submit a pull request!