Store the amplitude

This commit is contained in:
Luke Murphy 2020-02-07 12:52:37 +01:00
parent c9bf6f5e5d
commit 8af457e626
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -80,7 +80,7 @@ function stop() {
pitch = fft.analyze(); pitch = fft.analyze();
// https://p5js.org/reference/#/p5.SoundFile/getPeaks // https://p5js.org/reference/#/p5.SoundFile/getPeaks
amplitude = recording.getPeaks(); amplitude = recording.getPeaks(1)[0] * 100;
// https://p5js.org/reference/#/p5.SoundFile/duration // https://p5js.org/reference/#/p5.SoundFile/duration
duration = recording.duration(); duration = recording.duration();