Reference play()

play()

Play tells the envelope to start acting on a given input. If the input is a p5.sound object (i.e. AudioIn, Oscillator, SoundFile), then Envelope will control its output volume. Envelopes can also be used to control any Web Audio Audio Param.

Examples

Syntax

play(unit, [startTime], [sustainTime])

Parameters

unit
Object:

A p5.sound object or Web Audio Param.

startTime
Number:

time from now (in seconds) at which to play

sustainTime
Number:

time to sustain before releasing the envelope

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