Downloading Library
Hello,
I'm struggling to download this library. I'm trying to create a audio visualizer that's reactive to sound and lights up certain colors like a LED strip onto a set of squares in a div element that I wrote in my HTML script.
What's the best way to download Rhythm for it to work successfully?
//////////////
February 3, 2021
I keep launching my file on the Live Server. I check console log, and I keep seeing the error Rythm is not a constructor, even though I've uploaded the library half a dozen times. What's wrong?
Here's the repo (If it's not the first thing that pops up, then it's a branch named "rythm.js"): https://github.com/JustinDCole/UpdatedAudioVisualizer/blob/rhythm.js/Microphone.js
**I'm not uploading a song or audio file. I want to use the audio the audioContext processes from the microphone in the computer.
//////////////////////////////
I changed the error previously, just didn't update it on Github. Its spelled Rythm, and it's still coming up as an error. I also tried window.Rythm.
Hello @JustinDCole ! As stated in the getting started part of the doc you have two main way to use Rythm.js
If you are using either npm or yarn and ES6 Modules
- install the dependency (with
npm ioryarn add) - then in your javascript file use
import Rythm from 'rythm.js'to get the lib.
If you are using plain javascript and HTML
- Add the according javascript
scripttag using one of the CDN that host the library :
<script type="text/javascript" src="https://unpkg.com/rythm.js/rythm.js"></script>
- Then you can use rythm like this in your javascript file :
var rythm = new Rythm()
rythm.setMusic('path/to/sample.mp3')
rythm.start()
Hope it helps !
Hello,
I'm struggling to download this library. I'm trying to create a audio visualizer that's reactive to sound and lights up certain colors like a LED strip onto a set of squares in a div element that I wrote in my HTML script.
What's the best way to download Rhythm for it to work successfully?
Hello Justin, you are just misspelling the library name Rythm with the english correct spelling Rhythm
https://github.com/JustinDCole/UpdatedAudioVisualizer/blob/rhythm.js/Rhythm.js#L5
You should use new Rythm() and it should work as expected :+1:
Closing since there is no activity