# Libraries

**URL:** https://discourse.processing.org/c/p5js/p5js-libraries/20.md?page=7

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 8

---

## [I want stop the sounds from playing when the webpage is hidden](https://discourse.processing.org/t/i-want-stop-the-sounds-from-playing-when-the-webpage-is-hidden/29340)

<div class="topic-metadata">

**Author:** [@LaserDenis](https://discourse.processing.org/u/LaserDenis)\
**Replies:** 7\
**Last updated:** [April 13, 2021, 8:56pm UTC](https://discourse.processing.org/t/i-want-stop-the-sounds-from-playing-when-the-webpage-is-hidden/29340 "2021-04-13T20:56:34Z")

</div>

I tried to use document.hidden but I doesn’t seem to work .

---

## [P5.js serial port and Microbit connection](https://discourse.processing.org/t/p5-js-serial-port-and-microbit-connection/6986)

<div class="topic-metadata">

**Author:** [@loretod](https://discourse.processing.org/u/loretod)\
**Replies:** 10\
**Last updated:** [April 11, 2021, 9:17am UTC](https://discourse.processing.org/t/p5-js-serial-port-and-microbit-connection/6986 "2021-04-11T09:17:05Z")

</div>

I am working on getting the serial communication to work between a Microbit and p5.js. I’m pretty sure the Microbit side of the project is working since I am able to see the serial write in my terminal. On the p5.js sid…

---

## [Difference between collide and bounce in p5.play](https://discourse.processing.org/t/difference-between-collide-and-bounce-in-p5-play/29214)

<div class="topic-metadata">

**Author:** [@edufissure](https://discourse.processing.org/u/edufissure)\
**Replies:** 0\
**Last updated:** [April 8, 2021, 11:36am UTC](https://discourse.processing.org/t/difference-between-collide-and-bounce-in-p5-play/29214 "2021-04-08T11:36:48Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Im trying to implement a ping-pong game or pong, and i ask to myself what is better to use when ball bounces/collides with player…I assume i hav…

---

## [P5 Canvas and HTML](https://discourse.processing.org/t/p5-canvas-and-html/29196)

<div class="topic-metadata">

**Author:** [@karenmsn](https://discourse.processing.org/u/karenmsn)\
**Replies:** 2\
**Last updated:** [April 7, 2021, 7:18pm UTC](https://discourse.processing.org/t/p5-canvas-and-html/29196 "2021-04-07T19:18:52Z")

</div>

Hi! Quick question about using the P5 canvas with HTML code. I understand that calling createCanvas() creates the element in the HTML side of a website, but how do I reference that canvas in my HTML code in order to mov…

---

## [NodeJS with Fastify but want to make an canvas (p5js server-side)](https://discourse.processing.org/t/nodejs-with-fastify-but-want-to-make-an-canvas-p5js-server-side/24317)

<div class="topic-metadata">

**Author:** [@Bas950](https://discourse.processing.org/u/Bas950)\
**Replies:** 15\
**Last updated:** [April 6, 2021, 6:56am UTC](https://discourse.processing.org/t/nodejs-with-fastify-but-want-to-make-an-canvas-p5js-server-side/24317 "2021-04-06T06:56:44Z")

</div>

Hey so I am kinda new to this, But I am making an API using Fastify & NodeJS and want to add an overlay to a video, I have looked at multiple things and found that p5js would be the best for me, but I am failing to set …

---

## [Is there any way to implement invisibility using opencv js framework](https://discourse.processing.org/t/is-there-any-way-to-implement-invisibility-using-opencv-js-framework/29079)

<div class="topic-metadata">

**Author:** [@bandhavya](https://discourse.processing.org/u/bandhavya)\
**Replies:** 3\
**Last updated:** [April 3, 2021, 11:46am UTC](https://discourse.processing.org/t/is-there-any-way-to-implement-invisibility-using-opencv-js-framework/29079 "2021-04-03T11:46:45Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Is there a possibility of implementing something like this https://analyticsindiamag.com/my-fun-ai-project-how-to-be-invisible/ Is this possibl…

---

## [I can't seem to play sounds in javascript using p5.js](https://discourse.processing.org/t/i-cant-seem-to-play-sounds-in-javascript-using-p5-js/29043)

<div class="topic-metadata">

**Author:** [@LaserDenis](https://discourse.processing.org/u/LaserDenis)\
**Replies:** 13\
**Last updated:** [April 1, 2021, 12:46pm UTC](https://discourse.processing.org/t/i-cant-seem-to-play-sounds-in-javascript-using-p5-js/29043 "2021-04-01T12:46:56Z")

</div>

I am new to Js, and p5 and I was trying to play a mp3 from my computer, but I continually get this errors: Uncaught (in promise) ReferenceError: loadSound is not defined Uncaught TypeError: Cannot read property 'play' of…

---

## [Get whole Spectrum of an audio file using p5 sound](https://discourse.processing.org/t/get-whole-spectrum-of-an-audio-file-using-p5-sound/29046)

<div class="topic-metadata">

**Author:** [@readera](https://discourse.processing.org/u/readera)\
**Replies:** 1\
**Last updated:** [April 1, 2021, 9:21am UTC](https://discourse.processing.org/t/get-whole-spectrum-of-an-audio-file-using-p5-sound/29046 "2021-04-01T09:21:52Z")

</div>

In the example examples | p5.js 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 bei…

---

## [P5.js Canvas using Bootstrap](https://discourse.processing.org/t/p5-js-canvas-using-bootstrap/28994)

<div class="topic-metadata">

**Author:** [@karenmsn](https://discourse.processing.org/u/karenmsn)\
**Replies:** 0\
**Last updated:** [March 30, 2021, 8:11pm UTC](https://discourse.processing.org/t/p5-js-canvas-using-bootstrap/28994 "2021-03-30T20:11:08Z")

</div>

I’m trying to use Bootstrap to make my website with my p5.js code and I’m having a hard time with figuring out aligning my elements so the video canvas on top of the button on the left hand side. Any ideas why it’s not p…

---

## [Processing on Multiple Sound Files](https://discourse.processing.org/t/processing-on-multiple-sound-files/28805)

<div class="topic-metadata">

**Author:** [@karenmsn](https://discourse.processing.org/u/karenmsn)\
**Replies:** 2\
**Last updated:** [March 29, 2021, 1:32pm UTC](https://discourse.processing.org/t/processing-on-multiple-sound-files/28805 "2021-03-29T13:32:00Z")

</div>

Is there a way to apply multiple processes from the p5 sound library onto multiple sound files without calling to connect each sound file to the specific function? i.e. any way to combine all outputs of sound files so I …

---

## [Recreate canvas with p5 and Reactjs](https://discourse.processing.org/t/recreate-canvas-with-p5-and-reactjs/28900)

<div class="topic-metadata">

**Author:** [@caruso33](https://discourse.processing.org/u/caruso33)\
**Replies:** 2\
**Last updated:** [March 27, 2021, 2:10pm UTC](https://discourse.processing.org/t/recreate-canvas-with-p5-and-reactjs/28900 "2021-03-27T14:10:34Z")

</div>

Hi, I am trying to implement p5 with react. On the initial render the canvas gets created, however I want to restart the game by clicking a button. I see that the canvas is there but only it’s frame, it is never proper…

---

## [I am trying to load in a sound file to my p5 sound project, but they all come out distorted or my screen goes black](https://discourse.processing.org/t/i-am-trying-to-load-in-a-sound-file-to-my-p5-sound-project-but-they-all-come-out-distorted-or-my-screen-goes-black/6121)

<div class="topic-metadata">

**Author:** [@thesavgplatypus](https://discourse.processing.org/u/thesavgplatypus)\
**Replies:** 13\
**Last updated:** [March 26, 2021, 2:30pm UTC](https://discourse.processing.org/t/i-am-trying-to-load-in-a-sound-file-to-my-p5-sound-project-but-they-all-come-out-distorted-or-my-screen-goes-black/6121 "2021-03-26T14:30:30Z")

</div>

I have tried .ogg, .m4a, .mp3, everything. any suggestions?

---

## [Adding node module to p5.js](https://discourse.processing.org/t/adding-node-module-to-p5-js/28842)

<div class="topic-metadata">

**Author:** [@cenkakay08](https://discourse.processing.org/u/cenkakay08)\
**Replies:** 2\
**Last updated:** [March 25, 2021, 8:02pm UTC](https://discourse.processing.org/t/adding-node-module-to-p5-js/28842 "2021-03-25T20:02:35Z")

</div>

Hi everyone. I’m working on bin packing project. I want to use node module to placement of rectangles. Node module that I want to use: rectangle-bin-pack - npm I’m using p5.vscode extension on VS code for develop. Is t…

---

## [Export from P5 to PDF/SVG](https://discourse.processing.org/t/export-from-p5-to-pdf-svg/28530)

<div class="topic-metadata">

**Author:** [@xbix](https://discourse.processing.org/u/xbix)\
**Replies:** 4\
**Last updated:** [March 25, 2021, 9:28am UTC](https://discourse.processing.org/t/export-from-p5-to-pdf-svg/28530 "2021-03-25T09:28:14Z")

</div>

Hello, is it still possible to make an SVG/PDF export with P5? p5.svg.js doesn’t seem to work, see these threads about it: Has anyone found a way that works with the current version of P5? Thank you!

---

## [How to Unpause a sound file?](https://discourse.processing.org/t/how-to-unpause-a-sound-file/28565)

<div class="topic-metadata">

**Author:** [@DhawanGupta](https://discourse.processing.org/u/DhawanGupta)\
**Replies:** 3\
**Last updated:** [March 16, 2021, 3:35pm UTC](https://discourse.processing.org/t/how-to-unpause-a-sound-file/28565 "2021-03-16T15:35:12Z")

</div>

There is a function to pause a playing sound file. But, how to unpause it? Whenever I try to play it after pausing, it plays from the beginning, instead from where I paused it, contrary to reference document of pause()…

---

## [setInterval with Posenet](https://discourse.processing.org/t/setinterval-with-posenet/28405)

<div class="topic-metadata">

**Author:** [@karenmsn](https://discourse.processing.org/u/karenmsn)\
**Replies:** 1\
**Last updated:** [March 10, 2021, 7:17pm UTC](https://discourse.processing.org/t/setinterval-with-posenet/28405 "2021-03-10T19:17:32Z")

</div>

I have a quick question about using Posenet! I’m coding a website like you can see here: https://distracted-euclid-963531.netlify.app/ that uses body movement to process sound. Clicking the button starts a looped sound f…

---

## [Posenet and Low Pass Filters](https://discourse.processing.org/t/posenet-and-low-pass-filters/27393)

<div class="topic-metadata">

**Author:** [@karenmsn](https://discourse.processing.org/u/karenmsn)\
**Replies:** 6\
**Last updated:** [March 10, 2021, 5:58pm UTC](https://discourse.processing.org/t/posenet-and-low-pass-filters/27393 "2021-03-10T17:58:05Z")

</div>

I’m working on a project that uses body motion (through Posenet) to perform sound processing (i.e. nose movement pans audio from a sound file). At the moment, I’m trying to use my wrist’s motion to filter the audio on th…

---

## [Error when playing SoundFile](https://discourse.processing.org/t/error-when-playing-soundfile/23011)

<div class="topic-metadata">

**Author:** [@dansumption](https://discourse.processing.org/u/dansumption)\
**Replies:** 13\
**Last updated:** [March 6, 2021, 1:53pm UTC](https://discourse.processing.org/t/error-when-playing-soundfile/23011 "2021-03-06T13:53:38Z")

</div>

I have a p5js application which loads and plays a sound file. It was worked fine for a very long time, but suddenly it’s started throwing errors when I try to play the file. I’ve stripped the code down to its basics, as…

---

## [Browserify to require NPM Modules](https://discourse.processing.org/t/browserify-to-require-npm-modules/28242)

<div class="topic-metadata">

**Author:** [@diogorsergio](https://discourse.processing.org/u/diogorsergio)\
**Replies:** 4\
**Last updated:** [March 6, 2021, 12:46am UTC](https://discourse.processing.org/t/browserify-to-require-npm-modules/28242 "2021-03-06T00:46:23Z")

</div>

Hi, I’ve been playing around p5.js and manage to get the sketches running and rendering on the browser with VS code + Live Server. I wanted to take advantage of NPM modules with the require, but if I use browserify and…

---

## [Easycam and gui](https://discourse.processing.org/t/easycam-and-gui/28060)

<div class="topic-metadata">

**Author:** [@Madse20](https://discourse.processing.org/u/Madse20)\
**Replies:** 4\
**Last updated:** [March 5, 2021, 7:45pm UTC](https://discourse.processing.org/t/easycam-and-gui/28060 "2021-03-05T19:45:03Z")

</div>

I am trying to go a bit deeper into coding and would like to have easycam and a gui working together at the same time. I used easycam and P5gui, but thea seem to block each other. I would like to have the functionality …

---

## [Problem playing one sound and then other](https://discourse.processing.org/t/problem-playing-one-sound-and-then-other/28015)

<div class="topic-metadata">

**Author:** [@edufissure](https://discourse.processing.org/u/edufissure)\
**Replies:** 10\
**Last updated:** [February 27, 2021, 2:21pm UTC](https://discourse.processing.org/t/problem-playing-one-sound-and-then-other/28015 "2021-02-27T14:21:04Z")

</div>

Hello, im trying to implement pacman in p5.js. But im facing the problem that when i loose a game I play a song, a mp3 file… and then when i restart the game it should play initial sound/song. So im facing that the two…

---

## [P5 Delay Sound without User Interaction](https://discourse.processing.org/t/p5-delay-sound-without-user-interaction/27890)

<div class="topic-metadata">

**Author:** [@karenmsn](https://discourse.processing.org/u/karenmsn)\
**Replies:** 1\
**Last updated:** [February 22, 2021, 6:48pm UTC](https://discourse.processing.org/t/p5-delay-sound-without-user-interaction/27890 "2021-02-22T18:48:21Z")

</div>

Hi! I’m working on a project involving Posenet where body movement triggers sound processing. So far I have the nose panning audio from left to right and the left wrist’s vertical motion causing a delay on a bell sound. …

---

## [How to modify the program? Sound detection and face tracking](https://discourse.processing.org/t/how-to-modify-the-program-sound-detection-and-face-tracking/27881)

<div class="topic-metadata">

**Author:** [@KateK](https://discourse.processing.org/u/KateK)\
**Replies:** 5\
**Last updated:** [February 18, 2021, 6:52pm UTC](https://discourse.processing.org/t/how-to-modify-the-program-sound-detection-and-face-tracking/27881 "2021-02-18T18:52:38Z")

</div>

Hi, I’m learning programming and I’m stuck in one place. According to the code Cassie wrote on the webinar (https://www.youtube.com/watch?v=sRLWIAPaiRI&t=1546s), the sound comes when you click. I want the sound to go on…

---

## [Converting byte array or String to float](https://discourse.processing.org/t/converting-byte-array-or-string-to-float/27863)

<div class="topic-metadata">

**Author:** [@TanviM](https://discourse.processing.org/u/TanviM)\
**Replies:** 6\
**Last updated:** [February 18, 2021, 7:29am UTC](https://discourse.processing.org/t/converting-byte-array-or-string-to-float/27863 "2021-02-18T07:29:21Z")

</div>

Hi, I have been successful in getting serial data using this - GitHub - p5-serial/p5.serialport: Serial Port API and Server for p5.js library as either byte array or string values. But when I tried converting string t…

---

## [How do I load images with loadImage() and webpack?](https://discourse.processing.org/t/how-do-i-load-images-with-loadimage-and-webpack/25363)

<div class="topic-metadata">

**Author:** [@sdnorris](https://discourse.processing.org/u/sdnorris)\
**Replies:** 2\
**Last updated:** [February 15, 2021, 12:34pm UTC](https://discourse.processing.org/t/how-do-i-load-images-with-loadimage-and-webpack/25363 "2021-02-15T12:34:58Z")

</div>

Hello, I am using p5 in instance mode with an Express server in Node.js. I am importing the p5.js library via npm and webpack rather than with an inline script tag on an html document. This has been working fine, but I…

---

## [Make use of camera in device and live stream](https://discourse.processing.org/t/make-use-of-camera-in-device-and-live-stream/27834)

<div class="topic-metadata">

**Author:** [@bandhavya](https://discourse.processing.org/u/bandhavya)\
**Replies:** 0\
**Last updated:** [February 15, 2021, 9:33am UTC](https://discourse.processing.org/t/make-use-of-camera-in-device-and-live-stream/27834 "2021-02-15T09:33:15Z")

</div>

I want to live stream a video captured from mobile using p5.js. This is possible? any ideas how to implement? I checked the sample tutorials which opens the front webcam and it can be displayed on canvas. But incase i w…

---

## [High CPU / Crash under IOS Safari using p5 Audio js](https://discourse.processing.org/t/high-cpu-crash-under-ios-safari-using-p5-audio-js/27798)

<div class="topic-metadata">

**Author:** [@Skuenzl](https://discourse.processing.org/u/Skuenzl)\
**Replies:** 1\
**Last updated:** [February 14, 2021, 12:12am UTC](https://discourse.processing.org/t/high-cpu-crash-under-ios-safari-using-p5-audio-js/27798 "2021-02-14T00:12:53Z")

</div>

Hey ive using the Audio lib for my shooter game but at several times the sounds crashes my game (on mac and iphone) seems the sound is the Problem if i only load the shoot sound, the browser Crashes after a while. i mak…

---

## [Add song to sketch in Processing p5-Mode](https://discourse.processing.org/t/add-song-to-sketch-in-processing-p5-mode/27580)

<div class="topic-metadata">

**Author:** [@myCatIsAwesome](https://discourse.processing.org/u/myCatIsAwesome)\
**Replies:** 6\
**Last updated:** [February 6, 2021, 6:17pm UTC](https://discourse.processing.org/t/add-song-to-sketch-in-processing-p5-mode/27580 "2021-02-06T18:17:29Z")

</div>

I am using Processing in p5 Mode. I added a songfile to my sketch via sketch-\> add file (I hope that add file is the correct english translation). The thing is I tried all various ways to make it work code wise (preload…

---

## [Audio Without User Interaction?](https://discourse.processing.org/t/audio-without-user-interaction/27556)

<div class="topic-metadata">

**Author:** [@karenmsn](https://discourse.processing.org/u/karenmsn)\
**Replies:** 4\
**Last updated:** [February 4, 2021, 9:02am UTC](https://discourse.processing.org/t/audio-without-user-interaction/27556 "2021-02-04T09:02:09Z")

</div>

Any way to start audio without having a user click a key or button for p5.js?

---

## [Can p5js access the camera on a jetson nano?](https://discourse.processing.org/t/can-p5js-access-the-camera-on-a-jetson-nano/27494)

<div class="topic-metadata">

**Author:** [@skypickle](https://discourse.processing.org/u/skypickle)\
**Replies:** 2\
**Last updated:** [February 4, 2021, 12:37am UTC](https://discourse.processing.org/t/can-p5js-access-the-camera-on-a-jetson-nano/27494 "2021-02-04T00:37:17Z")

</div>

The jetson nano is a raspberry-pi like device and it can use raspberry pi cameras. It runs ubuntu and has a facility for running a webserver. I can execute p5js sketches fine. However I cannot get the the video from the…

[Previous page](https://discourse.processing.org/c/p5js/p5js-libraries/20.md?page=6)

[Next page](https://discourse.processing.org/c/p5js/p5js-libraries/20.md?page=8)
