# Get whole Spectrum of an audio file using p5 sound

**URL:** <https://discourse.processing.org/t/get-whole-spectrum-of-an-audio-file-using-p5-sound/29046>\
**Category:** Libraries\
**Created:** [April 1, 2021, 8:55am UTC](https://discourse.processing.org/t/get-whole-spectrum-of-an-audio-file-using-p5-sound/29046 "2021-04-01T08:55:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![readera](https://avatars.discourse-cdn.com/v4/letter/r/77aa72/32.png) [@readera](https://discourse.processing.org/u/readera)\
**Post date:** [April 1, 2021, 8:55am UTC](https://discourse.processing.org/t/get-whole-spectrum-of-an-audio-file-using-p5-sound/29046/1 "2021-04-01T08:55:55Z")

</div>

In the example [examples | p5.js](https://p5js.org/examples/sound-frequency-spectrum.html) of the Frequency Spectrum you can show the spectrum of the sound which is currently played.

Is it possible to get the whole spectrum of an file using FFT analyze from p5 sound without being played?

---

<div class="post-metadata">

**Author:** ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)\
**Post date:** [April 1, 2021, 9:21am UTC](https://discourse.processing.org/t/get-whole-spectrum-of-an-audio-file-using-p5-sound/29046/2 "2021-04-01T09:21:52Z")

</div>

no it has to `play` but you can connect the sound only to the analyzer by [`setInput`](https://p5js.org/reference/#/p5.FFT/setInput) (in theory; I haven’t tested yet). I found the implementation of p5.sound a bit confusing because they all default to output to master - maybe you need to explicitly [`disconnect`](https://p5js.org/reference/#/p5.SoundFile/disconnect) from the master.
