Reference onPeak()

onPeak()

onPeak accepts two arguments: a function to call when a peak is detected. The value of the peak, between 0.0 and 1.0, is passed to the callback.

Examples

Syntax

onPeak(callback, [val])

Parameters

callback
Function:

Name of a function that will be called when a peak is detected.

val
Object:

Optional value to pass into the function when a peak is detected.

Notice any errors or typos? Please let us know. Please feel free to edit lib/addons/p5.sound.js and open a pull request!

Related References