Get the current amplitude or 'loudness' of a sound. Useful for audio-reactive visualizations or analysis.
Examples
Syntax
p5.Amplitude([smoothing])
Parameters
smoothing
Number: Smooth the amplitude analysis by averaging with the last analysis frame. 0.0 is no time averaging with the last analysis frame.
Methods
setInput
Connect an audio source to the amplitude object.
getLevel
Get the current amplitude value of a sound.
smooth
Get the current amplitude value of a sound.
Notice any errors or typos? Please let us know. Please feel free to edit src/analysis/Amplitude.js and open a pull request!
Related References
getAudioContext
Get the window's audio context.
setAudioContext
Sets the AudioContext to a specified context to enable cross library compatibility.
userStartAudio
starts audio processing in the window when called from a user interaction (such as mousePressed()).
userStopAudio
stops audio processing in the browser window.