Reference toggleImpulse()

toggleImpulse()

If you have used .addImpulse() to add multiple impulses to a p5.Convolver, then you can use this method to toggle between the items in the .impulses Array. Accepts a parameter to identify which impulse you wish to use, identified either by its original filename (String) or by its position in the .impulses Array (Number).
You can access the objects in the .impulses Array directly. Each Object has two attributes: an .audioBuffer (type: Web Audio AudioBuffer) and a .name, a String that corresponds with the original filename.

Syntax

toggleImpulse(id)

Parameters

id
String|Number:

Identify the impulse by its original filename (String), or by its position in the .impulses Array (Number).

This page is generated from the comments in lib/addons/p5.sound.js . Please feel free to edit it and submit a pull request!

Related References