r/learnjavascript • u/frank0117 • Mar 19 '21
My hand-made vanilla JavaScript audio visualizers :D (source code included)
2
Mar 20 '21
Thanks how can i implement this into a wordpress site, with it visualizing any audio stresming on the page
3
u/frank0117 Mar 20 '21
You would need to route that audio through this codebase or copy its source and connect it that way. It really depends what audio that page plays. I explain basics of how how manage audio nodes in my beginner level tutorial. Not sure if it would work also for YouTube music video for example. If I figure that out I will make another tutorial.
2
2
u/playtrix Mar 20 '21
It's incredible really.
2
u/frank0117 Mar 20 '21
Glad you like it. I made many more this is just my top 10 of this batch :)
1
u/playtrix Mar 20 '21
You are talented Frank. Are you working as a dev now? I'm taking a boot camp next week. Hoping to break in as a dev.
3
u/frank0117 Mar 20 '21
Thank you. Yeah I work with JavaScript. Did the entire self taught thing in the past 5 years. Moved to London. Got a supermarket job and learned JavaScript from scratch after work. Took me 3 years to get my 1st dev job from the moment I started learning. It can be done much faster if you don't distract yourself by moving to a different country like I did ha. Good luck with your studies :)
1
u/playtrix Mar 20 '21
Thanks! Good job, you set a goal and stuck with it. I'm going to do the same.
2
2
1
1
1
u/amadeusjustinn Mar 20 '21
This is brilliant. But I have to ask what is that long string that audioSource is set to?
1
u/darkersauru5 Mar 20 '21 edited Mar 20 '21
He converted the audio file to base64 encoding
2
u/frank0117 Mar 21 '21
Yup. I linked YouTube tutorial where I code it and explain every line of code. Browsers block audio files and images when you try to analyse them so converting images and sound files to base64 string bypasses built in browser CORS security that would otherwise block it
1
u/darkersauru5 Mar 21 '21
To bypass CORS you could also host the audio files on the same domain as the page you want them to appear on I believe, obviously that isn’t possible with Codepen (unless you’ve got a project set up)
1
6
u/frank0117 Mar 19 '21
Tutorial with 10 effects: https://youtu.be/f0dwg99EVfo
Source code examples:
https://codepen.io/franksLaboratory/pen/wvoLVMr
https://codepen.io/franksLaboratory/pen/qBqzedW