Amplitude measures volume between 0.0 and 1.0. Listens to all p5sound by default, or use setInput() to listen to a specific sound source. Accepts an optional smoothing value, which defaults to 0.
Examples
Syntax
p5.Amplitude([smoothing])
Parameters
between 0.0 and .999 to smooth amplitude readings (defaults to 0)
Methods
Connects to the p5sound instance (main output) by default. Optionally, you can pass in a specific source (i.e. a soundfile).
Returns a single Amplitude reading at the moment it is called. For continuous readings, run in the draw loop.
Determines whether the results of Amplitude.process() will be Normalized. To normalize, Amplitude finds the difference the loudest reading it has processed and the maximum amplitude of 1.0. Amplitude adds this difference to all values to produce results that will reliably map between 0.0 and 1.0. However, if a louder moment occurs, the amount that Normalize adds to all the values will change. Accepts an optional boolean parameter (true or false). Normalizing is off by default.
Smooth Amplitude analysis by averaging with the last analysis frame. Off by default.