# Applying envelope functions to a soundfile

**URL:** https://discourse.processing.org/t/applying-envelope-functions-to-a-soundfile/10047
**Category:** Libraries
**Created:** [April 7, 2019, 12:33pm UTC](https://discourse.processing.org/t/applying-envelope-functions-to-a-soundfile/10047 "2019-04-07T12:33:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![l3ehfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/l3ehfar/32/4074_2.png) [@l3ehfar](https://discourse.processing.org/u/l3ehfar)
#### Post date: [April 7, 2019, 12:33pm UTC](https://discourse.processing.org/t/applying-envelope-functions-to-a-soundfile/10047/1 "2019-04-07T12:33:34Z")

</div>

due to my understanding of [p5js.org](http://p5js.org) examples, applying envelope is just acceptable to an oscillator or a wave which has been made by p5js synthesizer itself, is it any possibility to apply an envelope function to a sound file like mp3 files?

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [April 7, 2019, 1:08pm UTC](https://discourse.processing.org/t/applying-envelope-functions-to-a-soundfile/10047/2 "2019-04-07T13:08:13Z")

</div>

that is indeed possible,  
with:  
[https://p5js.org/reference/#/p5.Envelope/setInput](https://p5js.org/reference/#/p5.Envelope/setInput)  
example:  
[https://editor.p5js.org/kll/sketches/Z8H-Bu7Sq](https://editor.p5js.org/kll/sketches/Z8H-Bu7Sq)
